forked from code4romania/website-factory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
117 lines (98 loc) · 2.51 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
FROM node:20-alpine AS assets
WORKDIR /build
COPY app app
COPY help help
COPY lang lang
COPY resources resources
COPY \
.babelrc \
artisan \
package.json \
package-lock.json \
postcss.config.js \
tailwind.config.js \
vite.config.js \
./
RUN npm ci --no-audit --ignore-scripts
RUN npm run build
FROM php:8.1-fpm-alpine
ARG S6_OVERLAY_VERSION=3.1.6.2
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
ENTRYPOINT ["/init"]
COPY docker/openssl/openssl.cnf /etc/ssl/openssl.cnf
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/php/php.ini /usr/local/etc/php/php.ini
COPY docker/php/www.conf /usr/local/etc/php-fpm.d/zz-docker.conf
COPY docker/s6-rc.d /etc/s6-overlay/s6-rc.d
RUN apk update && \
# build dependencies
apk add --no-cache --virtual .build-deps \
bzip2-dev \
curl-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libxml2-dev \
libzip-dev \
postgresql-dev \
zlib-dev \
zip && \
#
# production dependencies
apk add --no-cache \
icu-libs \
libjpeg-turbo \
libpng \
libwebp \
libzip \
nginx \
php-pgsql && \
#
# configure extensions
docker-php-ext-configure gd --enable-gd --with-jpeg --with-webp && \
#
# install redis
pecl install redis && \
docker-php-ext-enable redis && \
#
# install extensions
docker-php-ext-install \
bcmath \
curl \
dom \
fileinfo \
gd \
intl \
opcache \
pdo_pgsql \
simplexml \
zip && \
#
# cleanup
apk del -f .build-deps
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV COMPOSER_CACHE_DIR /dev/null
WORKDIR /var/www
COPY --chown=www-data:www-data . /var/www
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
COPY --from=assets --chown=www-data:www-data /build/public/build /var/www/public/build
ARG VERSION
ARG REVISION
RUN echo "$VERSION (${REVISION:0:7})" > /var/www/.version
RUN composer install \
--optimize-autoloader \
--no-interaction \
--no-plugins \
--no-dev \
--prefer-dist
ENV APP_ENV production
ENV APP_DEBUG false
ENV LOG_CHANNEL stderr
ENV WEBSITE_FACTORY_EDITION ong
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME 0
EXPOSE 80