-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
112 lines (91 loc) · 2.85 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
FROM composer:2 AS composer_build
WORKDIR /srv/app
COPY composer.json composer.lock ./
RUN composer install \
--ignore-platform-reqs \
--no-ansi \
--no-autoloader \
--no-dev \
--no-interaction \
--no-plugins \
--no-progress \
--no-scripts \
--prefer-dist
FROM node:23 AS node_build
WORKDIR /srv/app
COPY package.json package-lock.json tsconfig.json webpack.config.js ./
COPY assets assets/
RUN set -e; \
npm install; \
npm run production;
FROM alpine:3.19
LABEL org.opencontainers.image.source=https://github.com/codedmonkey/dirigent
LABEL org.opencontainers.image.description="Dirigent PHP Package Registry"
LABEL org.opencontainers.image.licenses=FSL-1.1-MIT
ARG UID=1000
ARG GID=1000
COPY docker/entrypoint.sh docker/init.sh /srv/
RUN set -e; \
addgroup -g $GID -S dirigent; \
adduser -u $UID -S -G dirigent dirigent; \
apk upgrade --no-cache; \
apk add --no-cache --upgrade \
caddy \
curl \
git \
openssl \
php83 \
php83-ctype \
php83-curl \
php83-dom \
php83-fileinfo \
php83-fpm \
php83-iconv \
php83-intl \
php83-mbstring \
php83-openssl \
php83-pdo \
php83-pdo_pgsql \
php83-phar \
php83-session \
php83-simplexml \
php83-tokenizer \
php83-xml \
postgresql \
supervisor; \
ln -s /usr/bin/php83 /usr/bin/php; \
ln -s /usr/sbin/php-fpm83 /usr/sbin/php-fpm; \
mkdir -p /run/postgresql /srv/config /srv/data; \
chown -R dirigent:dirigent /run /srv; \
chmod +x /srv/entrypoint.sh /srv/init.sh;
COPY --from=composer_build /usr/bin/composer /usr/bin/composer
COPY docker/Caddyfile /etc/caddy/
COPY docker/php.ini /etc/php83/conf.d/
COPY docker/php-fpm.conf /etc/php83/
COPY docker/supervisord.conf /etc/
COPY docker/process /srv/process/
COPY docker/scripts /srv/scripts/
USER dirigent
WORKDIR /srv/app
COPY --chown=$UID:$GID --from=composer_build /srv/app ./
COPY --chown=$UID:$GID --from=node_build /srv/app/public/build public/build/
COPY --chown=$UID:$GID readme.md license.md ./
COPY --chown=$UID:$GID bin/console bin/dirigent bin/
COPY --chown=$UID:$GID docker/config.yaml config/dirigent.yaml
COPY --chown=$UID:$GID docker/env.php ./.env.dirigent.local.php
COPY --chown=$UID:$GID config config/
COPY --chown=$UID:$GID docs docs/
COPY --chown=$UID:$GID migrations migrations/
COPY --chown=$UID:$GID public public/
COPY --chown=$UID:$GID src src/
COPY --chown=$UID:$GID translations translations/
COPY --chown=$UID:$GID templates templates/
RUN set -e; \
chmod +x bin/console; \
chmod +x bin/dirigent; \
composer dump-autoload --classmap-authoritative --no-ansi --no-interaction;
VOLUME /srv/config
VOLUME /srv/data
EXPOSE 7015
ENTRYPOINT ["/srv/entrypoint.sh"]
CMD ["-init"]