-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
31 lines (25 loc) · 1014 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
FROM silarhi/php-apache:7.4-symfony
EXPOSE 80
WORKDIR /app
# Default APP_VERSION, real version will be given by the CD server
ARG APP_VERSION=dev
ENV APP_VERSION="${APP_VERSION}"
COPY symfony/ /app
RUN apt-get update && \
apt-get install -y libpng-dev && \
docker-php-ext-configure gd && \
docker-php-ext-install gd
RUN mkdir -p var && \
echo "APP_ENV=prod" > .env.local && \
echo "DATABASE_URL=sqlite:///%kernel.project_dir%/var/db.sqlite" >> .env.local && \
composer install --optimize-autoloader --no-interaction --no-ansi --no-dev && \
bin/console cache:clear --no-warmup && \
bin/console cache:warmup && \
# =============================================
# regenerate migrations for SQLite and run them
rm src/Migrations/*.php && \
bin/console doctrine:database:create && \
bin/console doctrine:migrations:diff && \
bin/console doctrine:migrations:migrate && \
# =============================================
chown -R www-data:www-data var