-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (56 loc) · 1.45 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
ARG ALPINE_VERSION="3.19"
ARG CADDY_VERSION="2.7"
ARG PHP_VERSION="8.3"
ARG COMPOSER_VERSION="2.7"
FROM composer:${COMPOSER_VERSION} AS composer
FROM alpine:${ALPINE_VERSION}
ARG CADDY_VERSION
ARG COMPOSER_VERSION
LABEL Maintainer="NiftyCo, LLC <[email protected]>"
LABEL Description="Lightweight Alpine Linux container with Caddy & PHP"
WORKDIR /app
RUN apk add --no-cache \
curl \
caddy=~${CADDY_VERSION} \
php83 \
php83-ctype \
php83-curl \
php83-dom \
php83-exif \
php83-fileinfo \
php83-fpm \
php83-gd \
php83-intl \
php83-mbstring \
php83-opcache \
php83-openssl \
php83-pcntl \
php83-pdo_pgsql \
php83-pgsql \
php83-phar \
php83-session \
php83-simplexml \
php83-tokenizer \
php83-xml \
php83-xmlreader \
php83-xmlwriter \
php83-zip \
supervisor
COPY Caddyfile /etc/caddy/Caddyfile
ENV PHP_INI_DIR="/etc/php83"
COPY fpm-pool.conf ${PHP_INI_DIR}/php-fpm.d/www.conf
COPY php.ini ${PHP_INI_DIR}/conf.d/custom.ini
RUN ln -s /usr/bin/php83 /usr/bin/php
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN mkdir -p /.composer && \
mkdir -p /.config && \
mkdir -p /.cache && \
mkdir -p /.local
RUN chown -R nobody.nobody /app /run /.composer /.config /.cache /.local
COPY entrypoint.sh /usr/bin/entrypoint
RUN chmod +x /usr/bin/entrypoint
USER nobody
COPY --chown=nobody index.php /app/
EXPOSE 8080
ENTRYPOINT ["/usr/bin/entrypoint"]