Skip to content

Commit 88f597d

Browse files
Update nixpacks.toml
1 parent 09e6d4e commit 88f597d

File tree

1 file changed

+17
-30
lines changed

1 file changed

+17
-30
lines changed

nixpacks.toml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
[phases.setup]
2-
nixPkgs = ["...", "python311Packages.supervisor"]
2+
nixPkgs = ["python311Packages.supervisor"]
33

44
[phases.build]
55
cmds = [
66
"mkdir -p /etc/supervisor/conf.d/",
77
"cp /assets/worker-*.conf /etc/supervisor/conf.d/",
88
"cp /assets/supervisord.conf /etc/supervisord.conf",
99
"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"
1619
]
1720

1821
[start]
@@ -25,9 +28,10 @@ cmd = '/assets/start.sh'
2528
# Transform the nginx configuration
2629
node /assets/scripts/prestart.mjs /assets/nginx.template.conf /etc/nginx.conf
2730
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
3135
3236
# Start supervisor
3337
supervisord -c /etc/supervisord.conf -n
@@ -86,27 +90,13 @@ autostart=true
8690
autorestart=true
8791
stopasgroup=true
8892
killasgroup=true
89-
numprocs=4
93+
numprocs=2
9094
startsecs=0
9195
stopwaitsecs=3600
9296
stdout_logfile=/var/log/worker-laravel.log
9397
stderr_logfile=/var/log/worker-laravel.log
9498
'''
9599

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-
110100
"php-fpm.conf" = '''
111101
[www]
112102
listen = 127.0.0.1:9000
@@ -152,11 +142,8 @@ http {
152142
listen [::]:${PORT};
153143
server_name localhost;
154144
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;
160147
161148
add_header X-Content-Type-Options "nosniff";
162149

0 commit comments

Comments
 (0)