File tree Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Expand file tree Collapse file tree 5 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 1
- FROM php:7.4.2 -fpm-alpine3.11
1
+ FROM php:7.4.4 -fpm-alpine3.11
2
2
3
3
ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="0" \
4
4
PHP_OPCACHE_MAX_ACCELERATED_FILES="10000" \
@@ -106,5 +106,5 @@ COPY ./root/.bashrc /root/
106
106
RUN find /home/app -name "run-*.sh" -exec chmod -v +x {} \;
107
107
108
108
# run the application
109
- CMD /home/app/run-dev .sh
109
+ CMD /home/app/run-prod .sh
110
110
EXPOSE 8080
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ version: '3.7'
45
45
services :
46
46
app :
47
47
build : .
48
+ command : /home/app/run-dev.sh
48
49
restart : unless-stopped
49
50
environment :
50
51
- PHP_OPCACHE_VALIDATE_TIMESTAMPS=1
Original file line number Diff line number Diff line change 1
1
user nginx;
2
2
worker_processes 4 ;
3
3
4
- error_log /var/log/nginx/ error.log warn ;
5
- pid /var/run/nginx.pid;
4
+ error_log /dev/stdout error.log warn ;
5
+ pid /var/run/nginx.pid;
6
6
7
7
events {
8
8
worker_connections 1024 ;
@@ -11,18 +11,18 @@ events {
11
11
}
12
12
13
13
http {
14
- include /etc/nginx/mime.types;
15
- default_type application/octet-stream;
14
+ include /etc/nginx/mime.types;
15
+ default_type application/octet-stream;
16
16
17
17
log_format main '$remote_addr - $remote_user [$time_local ] "$request " '
18
18
'$status $body_bytes_sent "$http_referer " '
19
19
'"$http_user_agent " "$http_x_forwarded_for "' ;
20
20
21
- access_log /var/log/nginx/ access.log main ;
21
+ access_log /dev/stdout access.log main ;
22
22
23
- sendfile on ;
23
+ sendfile on ;
24
24
25
- keepalive_timeout 65 ;
25
+ keepalive_timeout 65 ;
26
26
27
27
include /etc/nginx/conf.d/*.conf;
28
28
}
Original file line number Diff line number Diff line change 19
19
# migrate and setup database
20
20
wait-for-it.sh mysql:3306
21
21
php artisan migrate --force
22
+ php artisan setup
22
23
23
24
# start the services
24
25
exec runsvdir /etc/service
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ echo " Running via PROD script..."
3
+ cd /opt/app
4
+
5
+ # make sure Laravel can write its own files
6
+ mkdir -p /opt/app/storage/logs/
7
+ touch /opt/app/storage/logs/laravel.log
8
+ touch /opt/app/storage/logs/worker.log
9
+ chown www-data:www-data -R /opt/app/storage
10
+ chown www-data:www-data -R /opt/app/bootstrap/cache
11
+
12
+ # migrate and setup database
13
+ wait-for-it.sh mysql:3306
14
+ php artisan migrate --force
15
+ php artisan setup
16
+
17
+ # build caches
18
+ php artisan config:cache
19
+ php artisan route:cache
20
+ php artisan view:cache
21
+
22
+ # restart the Horizon supervisors
23
+ php artisan horizon:restart
24
+
25
+ # start the services
26
+ exec runsvdir /etc/service
You can’t perform that action at this time.
0 commit comments