feat: cd
This commit is contained in:
@@ -38,9 +38,6 @@ jobs:
|
||||
docker compose -f docker-compose.prod.yml pull
|
||||
|
||||
echo "Redémarrage"
|
||||
docker compose -f docker-compose.prod.yml up -d
|
||||
|
||||
echo "Migration Laravel"
|
||||
docker compose -f docker-compose.prod.yml exec -T app php artisan migrate --force
|
||||
docker compose -f docker-compose.prod.yml up -d --wait --wait-timeout 180
|
||||
|
||||
EOF
|
||||
|
||||
+11
-3
@@ -1,9 +1,10 @@
|
||||
FROM dunglas/frankenphp:php8.2-alpine
|
||||
FROM dunglas/frankenphp:php8.4-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
RUN install-php-extensions \
|
||||
bcmath \
|
||||
pdo_pgsql \
|
||||
opcache \
|
||||
pcntl \
|
||||
@@ -31,13 +32,20 @@ RUN composer dump-autoload --optimize
|
||||
|
||||
|
||||
|
||||
RUN chown -R www-data:www-data storage bootstrap/cache
|
||||
RUN mkdir -p \
|
||||
storage/app/public \
|
||||
storage/framework/cache/data \
|
||||
storage/framework/sessions \
|
||||
storage/framework/views \
|
||||
storage/logs \
|
||||
bootstrap/cache \
|
||||
&& chown -R www-data:www-data storage bootstrap/cache
|
||||
|
||||
|
||||
COPY docker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
|
||||
EXPOSE 8002
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
+12
-4
@@ -5,8 +5,10 @@ x-app-image: &app-image git.leonmorival.xyz/leonm/daily-meal-api:${IMAGE_TAG:-la
|
||||
x-app-environment: &app-environment
|
||||
APP_ENV: production
|
||||
APP_DEBUG: "false"
|
||||
APP_RUNTIME: "Laravel\\FrankenPHP\\Runtime"
|
||||
SERVER_NAME: ":80"
|
||||
OCTANE_SERVER: frankenphp
|
||||
OCTANE_PORT: "80"
|
||||
OCTANE_ADMIN_PORT: "2019"
|
||||
OCTANE_MAX_REQUESTS: "500"
|
||||
DB_CONNECTION: pgsql
|
||||
DB_HOST: postgres
|
||||
DB_PORT: "5432"
|
||||
@@ -17,8 +19,8 @@ x-app-environment: &app-environment
|
||||
MEILISEARCH_HOST: http://meilisearch:7700
|
||||
|
||||
x-app-volumes: &app-volumes
|
||||
- storage-data:/var/www/html/storage/app
|
||||
- storage-public-data:/var/www/html/storage/app/public
|
||||
- storage-data:/app/storage/app
|
||||
- storage-public-data:/app/storage/app/public
|
||||
|
||||
x-app-service: &app-service
|
||||
image: *app-image
|
||||
@@ -54,11 +56,17 @@ services:
|
||||
horizon:
|
||||
<<: *app-service
|
||||
container_name: daily-meal-api-horizon
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
command: ["php", "artisan", "horizon"]
|
||||
|
||||
scheduler:
|
||||
<<: *app-service
|
||||
container_name: daily-meal-api-scheduler
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
command: ["php", "artisan", "schedule:work"]
|
||||
|
||||
postgres:
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
cd /app
|
||||
|
||||
# Allow Docker Compose services such as Horizon and the scheduler to override
|
||||
# the default FrankenPHP process with their own command.
|
||||
if [ "$#" -gt 0 ]; then
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
echo "Preparing Laravel..."
|
||||
php artisan storage:link --force --no-interaction
|
||||
php artisan migrate --force --no-interaction
|
||||
php artisan optimize --no-interaction
|
||||
|
||||
echo "Starting Laravel Octane with FrankenPHP..."
|
||||
exec php artisan octane:frankenphp \
|
||||
--host=0.0.0.0 \
|
||||
--port="${OCTANE_PORT:-80}" \
|
||||
--admin-host=127.0.0.1 \
|
||||
--admin-port="${OCTANE_ADMIN_PORT:-2019}" \
|
||||
--workers="${OCTANE_WORKERS:-auto}" \
|
||||
--max-requests="${OCTANE_MAX_REQUESTS:-500}" \
|
||||
--no-interaction
|
||||
Reference in New Issue
Block a user