File tree Expand file tree Collapse file tree 8 files changed +34
-48
lines changed Expand file tree Collapse file tree 8 files changed +34
-48
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,9 @@ RUN yarn config set strict-ssl false && \
100
100
101
101
# copy root folder and make run scripts executable
102
102
COPY ./root/ /root/
103
- RUN find /root -name "run-*.sh" -exec chmod -v +x {} \;
104
- RUN chmod +x /root/entrypoint.sh
103
+ RUN find /root -name "*.sh" -exec chmod -v +x {} \;
105
104
106
105
# run the application
107
106
ENTRYPOINT ["/root/entrypoint.sh" ]
108
- CMD /root/run-prod.sh
107
+ CMD [ "runsvdir" , "/etc/service" ]
109
108
EXPOSE 8080
Original file line number Diff line number Diff line change @@ -45,11 +45,13 @@ 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
52
+ - STARTUP_COMMAND1=/root/modules/dev.sh
53
+ - STARTUP_COMMAND2=php artisan migrate --force
54
+ - STARTUP_COMMAND3=php artisan setup
53
55
volumes :
54
56
- ./:/opt/app:cached
55
57
ports :
@@ -80,13 +82,14 @@ version: '3.7'
80
82
services:
81
83
app:
82
84
image: sourceboat/docker-laravel
83
- command: /root/run-prod.sh
84
85
restart: unless-stopped
85
86
environment:
86
87
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
87
88
- PHP_MEMORY_LIMIT=1G
88
- - STARTUP_COMMAND1=php artisan migrate --force
89
- - STARTUP_COMMAND2=php artisan horizon:restart
89
+ - STARTUP_COMMAND1=/root/modules/storage.sh
90
+ - STARTUP_COMMAND2=/root/modules/cache.sh
91
+ - STARTUP_COMMAND3=php artisan migrate --force
92
+ - STARTUP_COMMAND4=php artisan horizon:restart
90
93
volumes:
91
94
- ./:/opt/app:cached
92
95
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