@@ -11,35 +11,58 @@ ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
11
11
PHP_FPM_PM="ondemand" \
12
12
PHP_FPM_PROCESS_IDLE_TIMEOUT="10s"
13
13
14
+ # create working dir
15
+ RUN mkdir /opt/app
16
+ WORKDIR /opt/app
17
+
18
+ # install wait-for-it
19
+ ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /usr/local/bin/
20
+ RUN chmod +x /usr/local/bin/wait-for-it.sh
21
+
22
+ # copy runit services
23
+ COPY ./etc/service/ /etc/service/
24
+ RUN find /etc/service/ -name "run" -exec chmod -v +x {} \;
25
+
26
+ # copy nginx config files
27
+ COPY ./etc/nginx/conf.d/ /etc/nginx/conf.d/
28
+ COPY ./etc/nginx/nginx.conf /etc/nginx/nginx.conf
29
+
30
+ # copy php config files
31
+ COPY ./usr/local/etc/php/ /usr/local/etc/php/
32
+ COPY ./usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/
33
+
34
+ # copy bin files
35
+ COPY ./usr/local/bin/startup-commands.php /usr/local/bin/
36
+
37
+ # copy root folder and make run scripts executable
38
+ COPY ./root/ /root/
39
+ RUN find /root -name "*.sh" -exec chmod -v +x {} \;
40
+
14
41
RUN apk info \
42
+ && echo @iconv-fix http://dl-cdn.alpinelinux.org/alpine/v3.13/community >> /etc/apk/repositories \
15
43
&& apk update \
16
44
&& apk upgrade \
17
45
&& apk add --no-cache --virtual .build-deps \
18
46
$PHPIZE_DEPS \
19
47
&& apk add --no-cache \
20
- sudo \
21
- runit \
22
- nginx \
23
48
zlib-dev \
24
49
icu-dev \
25
50
libzip-dev \
26
51
libjpeg-turbo-dev \
27
52
libpng-dev \
28
53
libxml2-dev \
29
54
freetype-dev \
55
+ gnu-libiconv@iconv-fix=1.15-r3 \
56
+ sudo \
30
57
bash \
58
+ runit \
59
+ nginx \
31
60
git \
32
61
nodejs \
33
62
npm \
34
- composer \
63
+ yarn \
35
64
mysql-client \
36
65
mariadb-connector-c \
37
- php8-dom \
38
- php8-tokenizer \
39
- php8-xml \
40
- php8-xmlwriter \
41
- php8-fileinfo \
42
- yarn \
43
66
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
44
67
&& docker-php-ext-install -j$(nproc) \
45
68
gd \
@@ -50,60 +73,28 @@ RUN apk info \
50
73
intl \
51
74
opcache \
52
75
pcntl \
53
- iconv \
54
- xml \
55
- xmlwriter \
56
- dom \
57
- tokenizer \
58
- fileinfo \
59
76
&& pecl install \
60
77
redis \
61
78
&& docker-php-ext-enable redis \
62
79
&& apk del .build-deps \
63
80
&& rm -rf /tmp/* /var/cache/apk/*
64
81
65
- # fix iconv (see https://github.com/docker-library/php/issues/240#issuecomment-876464325)
66
- RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted
67
- ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
68
-
69
- # change default shell
70
- SHELL ["/bin/bash" , "-c" ]
71
-
72
- # create working dir
73
- RUN mkdir /opt/app
74
- WORKDIR /opt/app
75
-
76
- # install wait-for-it
77
- ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /usr/local/bin/
78
- RUN chmod +x /usr/local/bin/wait-for-it.sh
79
-
80
- # copy runit services
81
- COPY ./etc/service/ /etc/service/
82
- RUN find /etc/service/ -name "run" -exec chmod -v +x {} \;
83
-
84
- # copy nginx config files
85
- COPY ./etc/nginx/conf.d/ /etc/nginx/conf.d/
86
- COPY ./etc/nginx/nginx.conf /etc/nginx/nginx.conf
87
-
88
- # copy php config files
89
- COPY ./usr/local/etc/php/ /usr/local/etc/php/
90
- COPY ./usr/local/etc/php-fpm.d/ /usr/local/etc/php-fpm.d/
91
-
92
- # copy bin files
93
- COPY ./usr/local/bin/startup-commands.php /usr/local/bin/
82
+ COPY --from=composer /usr/bin/composer /usr/bin/composer
94
83
95
84
# configure composer
96
85
ENV COMPOSER_ALLOW_SUPERUSER=1 \
97
86
COMPOSER_MEMORY_LIMIT=-1 \
98
87
PATH="$PATH:/opt/app/vendor/bin:~/.composer/vendor/bin"
99
88
89
+ # fix iconv (see https://github.com/docker-library/php/issues/240#issuecomment-876464325)
90
+ ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
91
+
100
92
# configure yarn
101
93
RUN yarn config set strict-ssl false && \
102
94
yarn global add cross-env
103
95
104
- # copy root folder and make run scripts executable
105
- COPY ./root/ /root/
106
- RUN find /root -name "*.sh" -exec chmod -v +x {} \;
96
+ # change default shell
97
+ SHELL ["/bin/bash" , "-c" ]
107
98
108
99
# run the application
109
100
ENTRYPOINT ["/root/entrypoint.sh" ]
0 commit comments