File tree Expand file tree Collapse file tree 8 files changed +35
-54
lines changed Expand file tree Collapse file tree 8 files changed +35
-54
lines changed Original file line number Diff line number Diff line change 1
- FROM php:7.4.8 -fpm-alpine3.11
1
+ FROM php:7.4.9 -fpm-alpine3.11
2
2
3
3
ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
4
4
PHP_OPCACHE_MAX_ACCELERATED_FILES="10000" \
@@ -10,8 +10,6 @@ ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
10
10
RUN apk info \
11
11
&& echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories \
12
12
&& echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
13
- && echo @3.9 http://dl-cdn.alpinelinux.org/alpine/v3.9/main >> /etc/apk/repositories \
14
- && echo @3.10 http://dl-cdn.alpinelinux.org/alpine/v3.10/main >> /etc/apk/repositories \
15
13
&& apk update \
16
14
&& apk upgrade \
17
15
&& apk add --no-cache --virtual .build-deps \
@@ -38,9 +36,6 @@ RUN apk info \
38
36
php7-dom \
39
37
mysql-client \
40
38
yarn@edge \
41
- xvfb \
42
- chromium@3.9 \
43
- chromium-chromedriver@3.9 \
44
39
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
45
40
&& docker-php-ext-install -j$(nproc) \
46
41
gd \
@@ -101,10 +96,9 @@ RUN yarn config set strict-ssl false && \
101
96
102
97
# copy root folder and make run scripts executable
103
98
COPY ./root/ /root/
104
- RUN find /root -name "run-*.sh" -exec chmod -v +x {} \;
105
- RUN chmod +x /root/entrypoint.sh
99
+ RUN find /root -name "*.sh" -exec chmod -v +x {} \;
106
100
107
101
# run the application
108
102
ENTRYPOINT ["/root/entrypoint.sh" ]
109
- CMD /root/run-prod.sh
103
+ CMD [ "runsvdir" , "/etc/service" ]
110
104
EXPOSE 8080
Original file line number Diff line number Diff line change @@ -45,12 +45,14 @@ version: '3.7'
45
45
services :
46
46
app :
47
47
build : .
48
- command : /root/run-dev.sh
49
48
restart : unless-stopped
50
49
environment :
51
50
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
52
51
- PHP_MEMORY_LIMIT=1G
53
52
- PHP_MAX_EXECUTION_TIME=30
53
+ - STARTUP_COMMAND1=/root/modules/dev.sh
54
+ - STARTUP_COMMAND2=php artisan migrate --force
55
+ - STARTUP_COMMAND3=php artisan setup
54
56
volumes :
55
57
- ./:/opt/app:cached
56
58
ports :
@@ -81,14 +83,15 @@ version: '3.7'
81
83
services:
82
84
app:
83
85
image: sourceboat/docker-laravel
84
- command: /root/run-prod.sh
85
86
restart: unless-stopped
86
87
environment:
87
88
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
88
89
- PHP_MEMORY_LIMIT=1G
89
90
- PHP_MAX_EXECUTION_TIME=30
90
- - STARTUP_COMMAND1=php artisan migrate --force
91
- - STARTUP_COMMAND2=php artisan horizon:restart
91
+ - STARTUP_COMMAND1=/root/modules/storage.sh
92
+ - STARTUP_COMMAND2=/root/modules/cache.sh
93
+ - STARTUP_COMMAND3=php artisan migrate --force
94
+ - STARTUP_COMMAND4=php artisan horizon:restart
92
95
volumes:
93
96
- ./:/opt/app:cached
94
97
ports:
Original file line number Diff line number Diff line change @@ -10,13 +10,12 @@ touch /opt/app/storage/logs/worker.log
10
10
chown www-data:www-data -R /opt/app/storage
11
11
chown www-data:www-data -R /opt/app/bootstrap/cache
12
12
13
- cd /opt/app
14
-
15
- # create storage symlink
16
- echo " create storage symlink..."
17
- su www-data -s /bin/sh -c " php artisan storage:link -q"
18
-
19
13
# startup commands
14
+ echo " Running startup commands..."
20
15
php /usr/local/bin/startup-commands.php | bash
21
16
17
+ if [[ -n " $DB_HOST " || -n " $DB_PORT " ]]; then
18
+ wait-for-it.sh --host=$DB_HOST --port=$DB_PORT
19
+ fi
20
+
22
21
exec " $@ "
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ cd /opt/app
4
+
5
+ # build caches
6
+ echo " Build caches..."
7
+ php artisan config:cache
8
+ php artisan route:cache
9
+ php artisan view:cache
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ cd /opt/app
3
+
4
+ echo " Build development..."
5
+ composer install --prefer-dist --no-progress --no-interaction
6
+ yarn
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ cd /opt/app
3
+
4
+ echo " Create storage symlink..."
5
+ su www-data -s /bin/sh -c " php artisan storage:link -q"
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments