-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (56 loc) · 2.02 KB
/
Dockerfile
File metadata and controls
68 lines (56 loc) · 2.02 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
##########
# Assets #
##########
# Frontend code builder
FROM node:24-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.4-fpm AS backend-deployment
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
php8.4-sqlite \
php8.4-mysql \
php8.4-intl \
wget \
tar \
patchelf \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/log/* /var/cache/* /usr/share/doc/*
WORKDIR /application/libcurl-impersonate
RUN wget -O libcurl-impersonate.tar.gz https://github.com/lexiforest/curl-impersonate/releases/download/v1.3.1/libcurl-impersonate-v1.3.1.x86_64-linux-gnu.tar.gz \
&& echo "14166d04cac7fb241c041a0f847de96ccca77e7eda483edf73d65f906e1d38e6 libcurl-impersonate.tar.gz" > checksum.sha256 \
&& sha256sum --check checksum.sha256 || exit 1 \
&& tar -xf libcurl-impersonate.tar.gz \
&& patchelf --set-soname libcurl.so.4 /application/libcurl-impersonate/libcurl-impersonate.so
ENV LD_PRELOAD=/application/libcurl-impersonate/libcurl-impersonate.so
ENV CURL_IMPERSONATE=chrome142
ENV APP_ENV=prod
ENV APP_SECRET=""
WORKDIR /application
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/