-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.production
42 lines (32 loc) · 1.35 KB
/
Dockerfile.production
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
# syntax=docker/dockerfile:1
FROM webdevops/php-nginx:8.3-alpine
ARG buildno
ARG gitcommithash
RUN echo "Build number: $buildno"
RUN echo "Based on commit: $gitcommithash"
ENV WEB_DOCUMENT_ROOT "/app/webroot"
# Copy app data
COPY --chown="${APPLICATION_USER}":"${APPLICATION_USER}" ./ /app
# Install acme.sh and create volume for data
ENV LE_WORKING_DIR "/acme.sh"
ENV LE_CONFIG_HOME "/acme"
VOLUME [ "/acme" ]
RUN curl https://get.acme.sh | sh
RUN ln -s /acme.sh/acme.sh /usr/local/bin/acme.sh && crontab -l | grep acme.sh | sed 's#> /dev/null##' | crontab -
# Install ping command
RUN set -x \
&& apk add -U --no-cache iputils \
&& docker-image-cleanup
# Install PECL-DBASE extension
RUN set -x \
&& apk add -U --no-cache autoconf gcc libc-dev make \
&& CPPFLAGS="-DHAVE_SYS_FILE_H" pecl install dbase \
&& docker-php-ext-enable dbase \
&& docker-run-bootstrap \
&& docker-image-cleanup
# Composer install
RUN gosu "${APPLICATION_USER}" composer install -d /app --no-interaction --no-dev
# Add on-start commands
RUN echo '# Composer oprations' >> /opt/docker/provision/entrypoint.d/99-composer.sh \
&& echo 'gosu "${APPLICATION_USER}" composer run-script migrations -d /app' >> /opt/docker/provision/entrypoint.d/99-composer.sh \
&& echo 'gosu "${APPLICATION_USER}" composer run-script schema-cache -d /app' >> /opt/docker/provision/entrypoint.d/99-composer.sh