-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
102 lines (76 loc) · 2.25 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
ARG PHP_VERSION=8.3
ARG FRANKENPHP_VERSION=latest
FROM dunglas/frankenphp:${FRANKENPHP_VERSION}-php${PHP_VERSION}-alpine
ARG S6_OVERLAY_VERSION="3.1.5.0"
ARG S6_OVERLAY_ARCH="x86_64"
ARG TZ=UTC
ARG WORK_DIR=/var/www/html
ARG APP_PATH
ARG USER=breeze
ARG UID=1000
ARG GID=1000
ARG COMPOSER_VERSION=2.7.1
ENV USER=${USER} \
UID=${UID} \
GID=${GID} \
WITH_OCTANE=false \
WITH_HORIZON=false \
WITH_SCHEDULER=false
ENV WORK_DIR=${WORK_DIR}
ENV APP_PATH=${APP_PATH}
ENV COMPOSER_VERSION=${COMPOSER_VERSION}
WORKDIR ${WORK_DIR}
RUN apk add --no-cache \
supervisor \
nodejs \
npm \
libzip-dev \
libxml2-dev \
librdkafka-dev \
g++ \
make \
autoconf \
&& apk del autoconf g++ make \
&& rm -rf /tmp/* \
&& rm -rf /var/cache/apk/*
RUN install-php-extensions \
redis \
rdkafka \
exif \
pdo_mysql \
zip \
sockets \
pcntl \
opcache \
mongodb \
gd \
opcache \
intl \
bcmath
RUN install-php-extensions @composer-${COMPOSER_VERSION}
RUN adduser -D -u $UID -G www-data ${USER}
USER $USER
COPY --chown=${USER}:${USER} ./packages/ ./packages/
COPY --chown=${USER}:${USER} ./composer.json ./composer.json
COPY --chown=${USER}:${USER} ./composer.lock ./composer.lock
COPY --chown=${USER}:${USER} ${APP_PATH} ${APP_PATH}
# install deps in app path
RUN composer install --working-dir=${APP_PATH}
RUN chown -R $USER:www-data ${APP_PATH}/storage
RUN chown -R $USER:www-data ${APP_PATH}/bootstrap/cache
RUN chmod -R 775 ${APP_PATH}/storage
RUN chmod -R 775 ${APP_PATH}/bootstrap/cache
# copy devlopment node_modules deps
COPY --from=breezemm.com/bun:latest /temp/dev/node_modules /var/www/html/node_modules
# copy supervisord config
COPY --chown=${USER}:${USER} infra/supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY --chown=${USER}:${USER} infra/supervisord/supervisord.*.conf /etc/supervisor/conf.d/
COPY --chown=${USER}:${USER} infra/start-container /usr/local/bin/start-container
RUN chmod +x /usr/local/bin/start-container
ENTRYPOINT ["start-container"]
EXPOSE 8000
EXPOSE 443
EXPOSE 443/udp
EXPOSE 2019
CMD ["start-container"]
HEALTHCHECK --start-period=5s --interval=2s --timeout=5s --retries=8 CMD php ${APP_PATH}/artisan octane:status || exit 1