feat: cd
This commit is contained in:
@@ -38,9 +38,6 @@ jobs:
|
|||||||
docker compose -f docker-compose.prod.yml pull
|
docker compose -f docker-compose.prod.yml pull
|
||||||
|
|
||||||
echo "Redémarrage"
|
echo "Redémarrage"
|
||||||
docker compose -f docker-compose.prod.yml up -d
|
docker compose -f docker-compose.prod.yml up -d --wait --wait-timeout 180
|
||||||
|
|
||||||
echo "Migration Laravel"
|
|
||||||
docker compose -f docker-compose.prod.yml exec -T app php artisan migrate --force
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
+11
-3
@@ -1,9 +1,10 @@
|
|||||||
FROM dunglas/frankenphp:php8.2-alpine
|
FROM dunglas/frankenphp:php8.4-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
||||||
RUN install-php-extensions \
|
RUN install-php-extensions \
|
||||||
|
bcmath \
|
||||||
pdo_pgsql \
|
pdo_pgsql \
|
||||||
opcache \
|
opcache \
|
||||||
pcntl \
|
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
|
COPY docker/entrypoint.sh /entrypoint.sh
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 8002
|
EXPOSE 80
|
||||||
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
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
|
x-app-environment: &app-environment
|
||||||
APP_ENV: production
|
APP_ENV: production
|
||||||
APP_DEBUG: "false"
|
APP_DEBUG: "false"
|
||||||
APP_RUNTIME: "Laravel\\FrankenPHP\\Runtime"
|
OCTANE_SERVER: frankenphp
|
||||||
SERVER_NAME: ":80"
|
OCTANE_PORT: "80"
|
||||||
|
OCTANE_ADMIN_PORT: "2019"
|
||||||
|
OCTANE_MAX_REQUESTS: "500"
|
||||||
DB_CONNECTION: pgsql
|
DB_CONNECTION: pgsql
|
||||||
DB_HOST: postgres
|
DB_HOST: postgres
|
||||||
DB_PORT: "5432"
|
DB_PORT: "5432"
|
||||||
@@ -17,8 +19,8 @@ x-app-environment: &app-environment
|
|||||||
MEILISEARCH_HOST: http://meilisearch:7700
|
MEILISEARCH_HOST: http://meilisearch:7700
|
||||||
|
|
||||||
x-app-volumes: &app-volumes
|
x-app-volumes: &app-volumes
|
||||||
- storage-data:/var/www/html/storage/app
|
- storage-data:/app/storage/app
|
||||||
- storage-public-data:/var/www/html/storage/app/public
|
- storage-public-data:/app/storage/app/public
|
||||||
|
|
||||||
x-app-service: &app-service
|
x-app-service: &app-service
|
||||||
image: *app-image
|
image: *app-image
|
||||||
@@ -54,11 +56,17 @@ services:
|
|||||||
horizon:
|
horizon:
|
||||||
<<: *app-service
|
<<: *app-service
|
||||||
container_name: daily-meal-api-horizon
|
container_name: daily-meal-api-horizon
|
||||||
|
depends_on:
|
||||||
|
app:
|
||||||
|
condition: service_healthy
|
||||||
command: ["php", "artisan", "horizon"]
|
command: ["php", "artisan", "horizon"]
|
||||||
|
|
||||||
scheduler:
|
scheduler:
|
||||||
<<: *app-service
|
<<: *app-service
|
||||||
container_name: daily-meal-api-scheduler
|
container_name: daily-meal-api-scheduler
|
||||||
|
depends_on:
|
||||||
|
app:
|
||||||
|
condition: service_healthy
|
||||||
command: ["php", "artisan", "schedule:work"]
|
command: ["php", "artisan", "schedule:work"]
|
||||||
|
|
||||||
postgres:
|
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