forked from devfake/flox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
79 lines (73 loc) · 2.22 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
# syntax=docker/dockerfile:experimental
FROM composer:1.10.17@sha256:8d37a3118fc4dc5408f014faab1c3d6f9fbed7322f2cf887443f1bff7e722f5d AS composer
COPY . /flox
RUN set -ex; \
# When using a development container replace the above line with the one below and do 'DOCKER_BUILDKIT=1 docker build .' to cache the composer install
#RUN --mount=type=cache,target=/tmp/cache set -ex; \
\
cd /flox/backend; \
composer install;
FROM php:7.4.12-fpm-buster@sha256:ed5f18ce68f67f7fdff07a75a61c68c90a7c93c1568021b003dd41059358ad5e
RUN set -ex; \
groupadd --system foo; \
useradd --no-log-init --system --gid foo --create-home foo; \
apt-get update; \
apt-get install -y --no-install-recommends \
supervisor \
busybox-static \
gosu \
sqlite3 \
rsync \
; \
rm -rf /var/lib/apt/lists/*; \
\
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"; \
\
mkdir -p \
/var/log/supervisord \
/var/run/supervisord \
/var/www/flox \
;
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libpq-dev \
; \
\
docker-php-ext-install -j "$(nproc)" \
bcmath \
pdo_mysql \
pdo_pgsql \
opcache \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*;
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y \
nginx \
;
COPY --from=composer /flox /usr/share/flox
COPY docker/entrypoint.sh /entrypoint.sh
COPY docker/supervisord.conf /supervisord.conf
COPY docker/default.conf /etc/nginx/sites-enabled/default
WORKDIR /var/www/flox
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/supervisord.conf"]