Skip to content

Commit b7d1330

Browse files
author
Kevin Buchholz
committed
Merge branch 'release/0.20.0'
2 parents cf1a037 + 04bdf34 commit b7d1330

File tree

1 file changed

+39
-48
lines changed

1 file changed

+39
-48
lines changed

Dockerfile

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,58 @@ ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
1111
PHP_FPM_PM="ondemand" \
1212
PHP_FPM_PROCESS_IDLE_TIMEOUT="10s"
1313

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+
1441
RUN apk info \
42+
&& echo @iconv-fix http://dl-cdn.alpinelinux.org/alpine/v3.13/community >> /etc/apk/repositories \
1543
&& apk update \
1644
&& apk upgrade \
1745
&& apk add --no-cache --virtual .build-deps \
1846
$PHPIZE_DEPS \
1947
&& apk add --no-cache \
20-
sudo \
21-
runit \
22-
nginx \
2348
zlib-dev \
2449
icu-dev \
2550
libzip-dev \
2651
libjpeg-turbo-dev \
2752
libpng-dev \
2853
libxml2-dev \
2954
freetype-dev \
55+
gnu-libiconv@iconv-fix=1.15-r3 \
56+
sudo \
3057
bash \
58+
runit \
59+
nginx \
3160
git \
3261
nodejs \
3362
npm \
34-
composer \
63+
yarn \
3564
mysql-client \
3665
mariadb-connector-c \
37-
php8-dom \
38-
php8-tokenizer \
39-
php8-xml \
40-
php8-xmlwriter \
41-
php8-fileinfo \
42-
yarn \
4366
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
4467
&& docker-php-ext-install -j$(nproc) \
4568
gd \
@@ -50,60 +73,28 @@ RUN apk info \
5073
intl \
5174
opcache \
5275
pcntl \
53-
iconv \
54-
xml \
55-
xmlwriter \
56-
dom \
57-
tokenizer \
58-
fileinfo \
5976
&& pecl install \
6077
redis \
6178
&& docker-php-ext-enable redis \
6279
&& apk del .build-deps \
6380
&& rm -rf /tmp/* /var/cache/apk/*
6481

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
9483

9584
# configure composer
9685
ENV COMPOSER_ALLOW_SUPERUSER=1 \
9786
COMPOSER_MEMORY_LIMIT=-1 \
9887
PATH="$PATH:/opt/app/vendor/bin:~/.composer/vendor/bin"
9988

89+
# fix iconv (see https://github.com/docker-library/php/issues/240#issuecomment-876464325)
90+
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
91+
10092
# configure yarn
10193
RUN yarn config set strict-ssl false && \
10294
yarn global add cross-env
10395

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"]
10798

10899
# run the application
109100
ENTRYPOINT ["/root/entrypoint.sh"]

0 commit comments

Comments
 (0)