Skip to content

Commit f69cca2

Browse files
author
Kevin Buchholz
committed
move file copies to the top
1 parent 99ed24c commit f69cca2

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed

Dockerfile

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,33 @@ 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 \
1542
&& apk update \
1643
&& apk upgrade \
@@ -66,31 +93,6 @@ RUN apk info \
6693
RUN apk add gnu-libiconv=1.15-r3 --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.13/community/ --allow-untrusted
6794
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so
6895

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/
9496

9597
# configure composer
9698
ENV COMPOSER_ALLOW_SUPERUSER=1 \
@@ -101,9 +103,8 @@ ENV COMPOSER_ALLOW_SUPERUSER=1 \
101103
RUN yarn config set strict-ssl false && \
102104
yarn global add cross-env
103105

104-
# copy root folder and make run scripts executable
105-
COPY ./root/ /root/
106-
RUN find /root -name "*.sh" -exec chmod -v +x {} \;
106+
# change default shell
107+
SHELL ["/bin/bash", "-c"]
107108

108109
# run the application
109110
ENTRYPOINT ["/root/entrypoint.sh"]

0 commit comments

Comments
 (0)