-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (39 loc) · 1.06 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
FROM alpine:3.14
RUN apk add --no-cache --update \
nginx \
php7 \
php7-fpm \
php7-ctype \
php7-mbstring \
php7-json \
php7-opcache \
curl \
tzdata \
tini \
supervisor \
logrotate \
dcron \
libcap \
&& chown nobody:nobody /usr/sbin/crond \
&& setcap cap_setgid=ep /usr/sbin/crond \
&& mkdir -p /app /logs \
&& rm -rf /tmp/* \
/var/{cache,log}/* \
/etc/logrotate.d \
/etc/crontabs/* \
/etc/periodic/daily/logrotate
COPY rootfs /
RUN chown -R nobody:nobody /app \
&& chown -R nobody:nobody /logs \
&& chown -R nobody:nobody /run \
&& chown -R nobody:nobody /var/lib \
&& chown -R nobody:nobody /var/log/nginx \
&& chown -R nobody:nobody /etc/crontabs
USER nobody
WORKDIR /app
COPY --chown=nobody:nobody app /app
VOLUME "/logs"
EXPOSE 8080
ENTRYPOINT ["/sbin/tini", "--", "/usr/bin/docker-entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8080/fpm-ping