-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
54 lines (44 loc) · 1.35 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
##########
# Assets #
##########
# Frontend code builder
FROM node:18-alpine AS frontend-build
WORKDIR /application
COPY package.json yarn.lock ./
COPY webpack* ./
COPY tsconfig.json ./
COPY assets ./assets
COPY public ./public
RUN yarn install; \
yarn build
# Actual deployable image
FROM nginx:stable AS frontend-deployment
COPY --from=frontend-build /application/public/build /usr/share/nginx/html/build
###############
# PHP Backend #
###############
FROM phpdockerio/php:8.3-fpm AS backend-deployment
WORKDIR /application
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
php8.3-sqlite \
php8.3-mysql \
php8.3-intl \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* /var/cache/* /usr/share/doc/*
ENV APP_ENV=prod
ENV APP_SECRET=""
COPY bin/console ./bin/
COPY composer.* ./
COPY .env.dist ./.env
COPY config ./config
COPY public/index.php ./public/
COPY src ./src
COPY templates ./templates
COPY --from=frontend-build /application/public/build ./public/build
RUN composer install --no-dev --no-scripts; \
composer clear-cache; \
composer dump-autoload --optimize --classmap-authoritative; \
touch ./.env; \
bin/console cache:warmup; \
chown -R www-data:www-data ./var/