-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (35 loc) · 992 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM php:8.3-apache
ENV PUBLIC_FILESHARE_DIR=public
# Install packages
RUN set -eux; \
apt-get update; \
# Packages to install
apt-get install -y \
sudo \
zip \
unzip \
git \
&& \
# Grant www-data passwordless sudo
echo "www-data ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \
&& \
# Install Composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer \
&& \
# Clean out directories that don't need to be part of the image
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /var/www
COPY . .
RUN a2enmod rewrite \
&& \
ln -sf /var/www/site.conf /etc/apache2/sites-enabled/000-default.conf
RUN mkdir -p /var/cache/app \
&& \
chown -R www-data:www-data /var/cache/app
RUN chmod +x composer_install.sh
EXPOSE 80
CMD mkdir -p /var/www/${PUBLIC_FILESHARE_DIR} \
&& \
/var/www/composer_install.sh \
&& \
apache2ctl -D FOREGROUND