-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (22 loc) · 903 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
FROM yiisoftware/yii2-php:7.4-apache
ARG PHP_ENV=Development
ENV FE_HOST fe.local
ENV BE_HOST be.local
# Make both frontend and backend as vhosts of one container
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends default-mysql-client ca-certificates git unzip mc; \
# Duplicate vhost for backend
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/010-backend.conf; \
sed -i -e 's|/app/web|/app/frontend/web|g' /etc/apache2/sites-available/000-default.conf; \
sed -i -e 's|/app/web|/app/backend/web|g' /etc/apache2/sites-available/010-backend.conf; \
a2ensite 010-backend; \
if [ "$PHP_ENV" = "Production" ]; then \
ini_file="$PHP_INI_DIR/php.ini-production"; \
else \
ini_file="$PHP_INI_DIR/php.ini-development"; \
fi; \
cp $ini_file "$PHP_INI_DIR/php.ini"
COPY ./docker-run.sh /
RUN chmod +x /docker-run.sh
CMD /docker-run.sh