1
1
[phases .setup ]
2
- nixPkgs = [" ... " , " python311Packages.supervisor" ]
2
+ nixPkgs = [" python311Packages.supervisor" ]
3
3
4
4
[phases .build ]
5
5
cmds = [
6
6
" mkdir -p /etc/supervisor/conf.d/" ,
7
7
" cp /assets/worker-*.conf /etc/supervisor/conf.d/" ,
8
8
" cp /assets/supervisord.conf /etc/supervisord.conf" ,
9
9
" chmod +x /assets/start.sh" ,
10
- " composer install --no-dev" ,
11
- " php artisan optimize:clear" ,
12
- " php artisan config:cache" ,
13
- " php artisan route:cache" ,
14
- " php artisan view:cache" ,
15
- " npm ci && npm run build"
10
+ " composer install --no-dev --no-progress --prefer-dist --optimize-autoloader" ,
11
+ " npm ci" ,
12
+ " npm run build" ,
13
+ " php artisan cache:clear" ,
14
+ " php artisan route:clear" ,
15
+ " php artisan view:clear" ,
16
+ " php artisan config:clear" ,
17
+ " mkdir -p storage/framework/sessions storage/framework/views storage/framework/cache" ,
18
+ " chmod -R 775 storage bootstrap/cache"
16
19
]
17
20
18
21
[start ]
@@ -25,9 +28,10 @@ cmd = '/assets/start.sh'
25
28
# Transform the nginx configuration
26
29
node /assets/scripts/prestart.mjs /assets/nginx.template.conf /etc/nginx.conf
27
30
28
- # Laravel specific setup
29
- php artisan migrate --force
30
- php artisan storage:link
31
+ # Créer les liens symboliques pour le stockage si nécessaire
32
+ if [ ! -L /app/public/storage ]; then
33
+ php artisan storage:link
34
+ fi
31
35
32
36
# Start supervisor
33
37
supervisord -c /etc/supervisord.conf -n
@@ -86,27 +90,13 @@ autostart=true
86
90
autorestart=true
87
91
stopasgroup=true
88
92
killasgroup=true
89
- numprocs=4
93
+ numprocs=2
90
94
startsecs=0
91
95
stopwaitsecs=3600
92
96
stdout_logfile=/var/log/worker-laravel.log
93
97
stderr_logfile=/var/log/worker-laravel.log
94
98
'''
95
99
96
- "worker-scheduler.conf" = '''
97
- [program:worker-scheduler]
98
- process_name=%(program_name)s_%(process_num)02d
99
- command=bash -c 'while [ true ]; do php /app/artisan schedule:run --verbose --no-interaction & sleep 60; done'
100
- autostart=true
101
- autorestart=true
102
- stopasgroup=true
103
- killasgroup=true
104
- numprocs=1
105
- startsecs=0
106
- stdout_logfile=/var/log/worker-scheduler.log
107
- stderr_logfile=/var/log/worker-scheduler.log
108
- '''
109
-
110
100
"php-fpm.conf" = '''
111
101
[www]
112
102
listen = 127.0.0.1:9000
@@ -152,11 +142,8 @@ http {
152
142
listen [::]:${PORT};
153
143
server_name localhost;
154
144
155
- $if(NIXPACKS_PHP_ROOT_DIR) (
156
- root ${NIXPACKS_PHP_ROOT_DIR};
157
- ) else (
158
- root /app/public;
159
- )
145
+ # Utilise toujours /app/public comme racine
146
+ root /app/public;
160
147
161
148
add_header X-Content-Type-Options "nosniff";
162
149
0 commit comments