-
Notifications
You must be signed in to change notification settings - Fork 53
/
Dockerfile
83 lines (69 loc) · 2.02 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
FROM --platform=$BUILDPLATFORM alpine:3.17 as main
LABEL maintainer="Jorge Arco <[email protected]>"
RUN apk --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/main add \
icu-libs \
&&apk --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/community add \
# Current packages don't exist in other repositories
libavif \
&& apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted gnu-libiconv \
# Packages
tini \
php81 \
php81-dev \
php81-common \
php81-gd \
php81-xmlreader \
php81-bcmath \
php81-ctype \
php81-curl \
php81-exif \
php81-iconv \
php81-intl \
php81-mbstring \
php81-opcache \
php81-openssl \
php81-pcntl \
php81-phar \
php81-session \
php81-xml \
php81-xsl \
php81-zip \
php81-zlib \
php81-dom \
php81-fpm \
php81-sodium \
php81-tokenizer \
# Iconv Fix
php81-pecl-apcu \
&& ln -sf /usr/bin/php81 /usr/bin/php
ADD rootfs /
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/sbin/php-fpm81", "-R", "--nodaemonize"]
EXPOSE 9000
WORKDIR /app
FROM --platform=$BUILDPLATFORM main as dev
ARG USER=root
ARG PASSWORD=root
ARG COMPOSER_VERSION=2.5.1
RUN apk add -U --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ \
php81-pear \
openssh \
supervisor \
autoconf \
git \
curl \
wget \
make \
zip \
php81-xdebug \
# Delete APK cache.
&& rm -rf /var/cache/apk/* \
# Create ssh user for dev.
&& sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config \
&& echo "${USER}:${PASSWORD}" | chpasswd \
&& ssh-keygen -A \
# Download composer.
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION}
ADD devfs /
CMD ["supervisord", "--nodaemon", "--configuration", "/etc/supervisord/conf.d/supervisord.conf"]
EXPOSE 22 9003