-
Notifications
You must be signed in to change notification settings - Fork 54
/
Dockerfile
94 lines (76 loc) · 1.91 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
FROM --platform=$BUILDPLATFORM alpine:3.9 as main
LABEL maintainer="Jorge Arco <[email protected]>"
RUN apk --update add ca-certificates \
&& apk add -U \
# Packages
tini \
php7 \
php7-amqp \
php7-dev \
php7-common \
php7-apcu \
php7-bcmath \
php7-ctype \
php7-curl \
php7-exif \
php7-fileinfo \
php7-gd \
php7-iconv \
php7-intl \
php7-json \
php7-mbstring \
php7-opcache \
php7-openssl \
php7-pcntl \
php7-pdo \
php7-mysqlnd \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-phar \
php7-posix \
php7-soap \
php7-session \
php7-xml \
php7-xsl \
php7-zip \
php7-zlib \
php7-dom \
php7-redis \
php7-fpm \
php7-sodium \
php7-tokenizer \
php7-xmlwriter \
php7-simplexml \
# Clean up
&& rm -rf /var/cache/apk/*
ADD rootfs /
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/sbin/php-fpm7", "-R", "--nodaemonize"]
EXPOSE 9000
WORKDIR /app
FROM --platform=$BUILDPLATFORM main as dev
ARG USER=root
ARG PASSWORD=root
ARG COMPOSER_VERSION=1.10.1
RUN apk add -U --no-cache \
php7-pear \
openssh \
supervisor \
autoconf \
git \
curl \
wget \
make \
zip \
php7-xdebug \
&& rm -rf /var/cache/apk/* \
&& sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config \
&& echo "${USER}:${PASSWORD}" | chpasswd \
&& ssh-keygen -A \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --version=${COMPOSER_VERSION} \
&& composer global require "hirak/prestissimo:0.3.10"
ADD devfs /
RUN HOST_IP="$(/sbin/ip route|awk '/default/ { print $3 }')" \
&& sed -i "$ a\xdebug.remote_host=${HOST_IP}" /etc/php7/conf.d/00_xdebug.ini
CMD ["supervisord", "--nodaemon", "--configuration", "/etc/supervisor/conf.d/supervisord.conf"]
EXPOSE 22 9000