Skip to content

Commit 25310e4

Browse files
author
Kevin Buchholz
committed
Merge branch 'develop' into feature/add_build_stable_manual_workflow_action
2 parents de82cc4 + 970623a commit 25310e4

File tree

3 files changed

+44
-47
lines changed

3 files changed

+44
-47
lines changed

Dockerfile

Lines changed: 41 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.0-fpm-alpine
1+
FROM php:8.1-fpm-alpine
22

33
ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
44
PHP_OPCACHE_MAX_ACCELERATED_FILES="10000" \
@@ -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 \
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 \
1743
&& apk update \
1844
&& apk upgrade \
1945
&& apk add --no-cache --virtual .build-deps \
2046
$PHPIZE_DEPS \
2147
&& apk add --no-cache \
22-
sudo \
23-
runit \
24-
nginx \
2548
zlib-dev \
2649
icu-dev \
2750
libzip-dev \
2851
libjpeg-turbo-dev \
2952
libpng-dev \
3053
libxml2-dev \
3154
freetype-dev \
55+
gnu-libiconv@iconv-fix=1.15-r3 \
56+
sudo \
3257
bash \
58+
runit \
59+
nginx \
3360
git \
3461
nodejs \
3562
npm \
36-
composer \
37-
php8-tokenizer \
38-
php8-simplexml \
39-
php8-dom \
63+
yarn \
4064
mysql-client \
4165
mariadb-connector-c \
42-
yarn@edge \
4366
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
4467
&& docker-php-ext-install -j$(nproc) \
4568
gd \
@@ -50,56 +73,28 @@ RUN apk info \
5073
intl \
5174
opcache \
5275
pcntl \
53-
iconv \
5476
&& pecl install \
5577
redis \
56-
&& docker-php-ext-enable \
57-
redis \
78+
&& docker-php-ext-enable redis \
5879
&& apk del .build-deps \
5980
&& rm -rf /tmp/* /var/cache/apk/*
6081

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
9083

9184
# configure composer
9285
ENV COMPOSER_ALLOW_SUPERUSER=1 \
9386
COMPOSER_MEMORY_LIMIT=-1 \
9487
PATH="$PATH:/opt/app/vendor/bin:~/.composer/vendor/bin"
9588

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

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

10499
# run the application
105100
ENTRYPOINT ["/root/entrypoint.sh"]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ Check [releases](https://github.com/sourceboat/docker-laravel/releases) for all
114114
- [Phil-Bastian Berndt](https://github.com/pehbehbeh)
115115
- [Philipp Kübler](https://github.com/PKuebler)
116116
- [Kevin Buchholz](https://github.com/NeroAzure)
117+
- [Hauke Ingwersen](https://github.com/hingew)
117118
- [All Contributors](https://github.com/sourceboat/docker-laravel/graphs/contributors)
118119

119120
## License

docker-compose.test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
environment:
77
- STARTUP_COMMAND1=php --version
88
- STARTUP_COMMAND2=composer --version
9-
- STARTUP_COMMAND3=chmod +x /root/test/test-command.sh
9+
- STARTUP_COMMAND3=yarn -v
10+
- STARTUP_COMMAND4=chmod +x /root/test/test-command.sh
1011
volumes:
1112
- ./test:/root/test

0 commit comments

Comments
 (0)