Skip to content

Commit 50acc36

Browse files
committed
add dockerfile from m2
0 parents  commit 50acc36

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM mcr.microsoft.com/devcontainers/php:8.2
2+
3+
# Change default umask and add user to web group so we can share write permission on web files
4+
RUN sed -i 's/^UMASK\s*022/UMASK 002/' /etc/login.defs
5+
RUN usermod -aG www-data vscode
6+
7+
# Install MariaDB and Redis and PHP (incl Apache)
8+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9+
&& apt-get install -y libpng-dev libzip-dev \
10+
&& docker-php-ext-install mysqli pdo pdo_mysql \
11+
&& docker-php-ext-configure gd \
12+
&& docker-php-ext-install gd \
13+
&& pecl install redis zip \
14+
&& docker-php-ext-enable redis zip \
15+
&& apt-get install -y mariadb-server mariadb-client redis-server redis-tools \
16+
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
17+
18+
# Configure PHP, make memory_limit and upload_max_filesize match Pantheon
19+
RUN cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
20+
RUN sed -i 's/memory_limit\s*=.*/memory_limit=2048M/g' /usr/local/etc/php/php.ini
21+
RUN sed -i 's/post_max_size\s*=.*/post_max_size=100M/g' /usr/local/etc/php/php.ini
22+
RUN sed -i 's/upload_max_filesize\s*=.*/upload_max_filesize=100M/g' /usr/local/etc/php/php.ini
23+
24+
# Stop xdebug from spamming the console
25+
RUN echo 'xdebug.log_level = 0' >> /usr/local/etc/php/conf.d/xdebug.ini
26+
27+
# Only use higher port for Apache, so that port forwarding is more consistent.
28+
RUN sed -i 's/Listen\s*80$/# Listen 80/' /etc/apache2/ports.conf
29+
30+
# Install drush
31+
RUN curl -L https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar --output /usr/local/bin/drush
32+
RUN chmod +x /usr/local/bin/drush
33+
34+
# Install terminus
35+
RUN curl -L https://github.com/pantheon-systems/terminus/releases/latest/download/terminus.phar --output /usr/local/bin/terminus
36+
RUN chmod +x /usr/local/bin/terminus

0 commit comments

Comments
 (0)