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