Skip to content

Commit 4b60c03

Browse files
committed
re-write Dockerfile
1 parent e4ca3bf commit 4b60c03

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

dev/docker/Dockerfile

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
FROM php:8.3-apache
22

3-
ENV APACHE_DOCUMENT_ROOT /app/public
4-
WORKDIR /app
5-
6-
RUN <<EOR
73
# Install additional dependencies
8-
apt-get update
9-
apt-get install -y \
10-
git \
11-
zip \
12-
unzip \
13-
libpng-dev \
14-
libldap2-dev \
15-
libzip-dev \
16-
wait-for-it
17-
rm -rf /var/lib/apt/lists/*
4+
RUN apt-get update && \
5+
apt-get install -y \
6+
git \
7+
zip \
8+
unzip \
9+
libpng-dev \
10+
libldap2-dev \
11+
libzip-dev \
12+
wait-for-it && \
13+
rm -rf /var/lib/apt/lists/*
1814

19-
# Configure apache
20-
docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)"
21-
docker-php-ext-install pdo_mysql gd ldap zip
22-
pecl install xdebug
23-
docker-php-ext-enable xdebug
24-
a2enmod rewrite
25-
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
26-
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
15+
# Install PHP extensions
16+
RUN docker-php-ext-configure ldap --with-libdir="lib/$(gcc -dumpmachine)" && \
17+
docker-php-ext-install pdo_mysql gd ldap zip && \
18+
pecl install xdebug && \
19+
docker-php-ext-enable xdebug
2720

2821
# Install composer
29-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
22+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
23+
24+
# Configure apache
25+
RUN a2enmod rewrite && \
26+
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
27+
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
3028

3129
# Use the default production configuration and update it as required
32-
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
33-
sed -i 's/memory_limit = 128M/memory_limit = 512M/g' "$PHP_INI_DIR/php.ini"
34-
EOR
30+
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
31+
sed -i 's/memory_limit = 128M/memory_limit = 512M/g' "$PHP_INI_DIR/php.ini"
32+
33+
ENV APACHE_DOCUMENT_ROOT /app/public
34+
WORKDIR /app

0 commit comments

Comments
 (0)