feat: deploy
This commit is contained in:
+6
-166
@@ -1,105 +1,6 @@
|
||||
name: bemeal
|
||||
|
||||
# =========================
|
||||
# IMAGE
|
||||
# =========================
|
||||
x-app-image: &app-image gitea.leonmorival.com/daily_meal/bemeal-api:${IMAGE_TAG:-latest}
|
||||
|
||||
# =========================
|
||||
# ENV
|
||||
# =========================
|
||||
x-app-environment: &app-environment
|
||||
APP_LOCALE: "fr"
|
||||
APP_ENV: "production"
|
||||
APP_KEY: "${APP_KEY:?APP_KEY is required}"
|
||||
APP_URL: "${APP_URL:?APP_URL is required}"
|
||||
SERVER_NAME: ":80"
|
||||
APP_RUNTIME: "Laravel\\FrankenPHP\\Runtime"
|
||||
APP_DEBUG: "${APP_DEBUG:-false}"
|
||||
|
||||
FILESYSTEM_DISK: "public"
|
||||
|
||||
DB_CONNECTION: "pgsql"
|
||||
DB_HOST: "bemeal-pgsql"
|
||||
DB_PORT: "5432"
|
||||
DB_DATABASE: "${DB_DATABASE:?DB_DATABASE is required}"
|
||||
DB_USERNAME: "${DB_USERNAME:?DB_USERNAME is required}"
|
||||
DB_PASSWORD: "${DB_PASSWORD:?DB_PASSWORD is required}"
|
||||
|
||||
REDIS_HOST: "bemeal-redis"
|
||||
REDIS_CLIENT: "predis"
|
||||
QUEUE_CONNECTION: "redis"
|
||||
|
||||
SCOUT_DRIVER: "meilisearch"
|
||||
MEILISEARCH_HOST: "http://bemeal-meilisearch:7700"
|
||||
MEILISEARCH_KEY: "${MEILISEARCH_KEY:?MEILISEARCH_KEY is required}"
|
||||
|
||||
# =========================
|
||||
# VOLUMES
|
||||
# =========================
|
||||
x-app-volumes: &app-volumes
|
||||
- storage-data:/var/www/html/storage/app
|
||||
- storage-public-data:/var/www/html/storage/app/public
|
||||
|
||||
# =========================
|
||||
# DEPENDS
|
||||
# =========================
|
||||
x-app-depends-on: &app-depends-on
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
meilisearch:
|
||||
condition: service_started
|
||||
|
||||
# =========================
|
||||
# HEALTHCHECK
|
||||
# =========================
|
||||
x-app-healthcheck: &app-healthcheck
|
||||
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1/api/health >/dev/null 2>&1"]
|
||||
start_period: 30s
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 12
|
||||
|
||||
# =========================
|
||||
# APP BASE
|
||||
# =========================
|
||||
x-app-service: &app-service
|
||||
image: *app-image
|
||||
restart: unless-stopped
|
||||
depends_on: *app-depends-on
|
||||
environment: *app-environment
|
||||
volumes: *app-volumes
|
||||
networks:
|
||||
- internal
|
||||
- public
|
||||
stop_grace_period: 30s
|
||||
|
||||
# =========================
|
||||
# SERVICES
|
||||
# =========================
|
||||
services:
|
||||
|
||||
# =========================
|
||||
# BLUE
|
||||
# =========================
|
||||
bemeal-api-blue:
|
||||
<<: *app-service
|
||||
container_name: bemeal-api-blue
|
||||
healthcheck: *app-healthcheck
|
||||
|
||||
# =========================
|
||||
# GREEN
|
||||
# =========================
|
||||
bemeal-api-green:
|
||||
<<: *app-service
|
||||
container_name: bemeal-api-green
|
||||
healthcheck: *app-healthcheck
|
||||
|
||||
# =========================
|
||||
# DATABASE
|
||||
# =========================
|
||||
pgsql:
|
||||
image: postgres:15-alpine
|
||||
container_name: bemeal-pgsql
|
||||
@@ -117,11 +18,8 @@ services:
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
networks:
|
||||
- internal
|
||||
- kamal
|
||||
|
||||
# =========================
|
||||
# REDIS
|
||||
# =========================
|
||||
redis:
|
||||
image: redis:alpine
|
||||
container_name: bemeal-redis
|
||||
@@ -129,47 +27,8 @@ services:
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- internal
|
||||
- kamal
|
||||
|
||||
# =========================
|
||||
# HORIZON
|
||||
# =========================
|
||||
horizon:
|
||||
image: *app-image
|
||||
container_name: bemeal-horizon
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
environment: *app-environment
|
||||
volumes: *app-volumes
|
||||
command: php artisan horizon
|
||||
networks:
|
||||
- internal
|
||||
|
||||
# =========================
|
||||
# SCHEDULER
|
||||
# =========================
|
||||
scheduler:
|
||||
image: *app-image
|
||||
container_name: bemeal-scheduler
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
environment: *app-environment
|
||||
volumes: *app-volumes
|
||||
command: php artisan schedule:work
|
||||
networks:
|
||||
- internal
|
||||
|
||||
# =========================
|
||||
# ADMINER
|
||||
# =========================
|
||||
adminer:
|
||||
image: adminer:latest
|
||||
container_name: bemeal-adminer
|
||||
@@ -177,11 +36,8 @@ services:
|
||||
environment:
|
||||
ADMINER_DEFAULT_SERVER: bemeal-pgsql
|
||||
networks:
|
||||
- internal
|
||||
- kamal
|
||||
|
||||
# =========================
|
||||
# MEILISEARCH
|
||||
# =========================
|
||||
meilisearch:
|
||||
image: getmeili/meilisearch:latest
|
||||
container_name: bemeal-meilisearch
|
||||
@@ -192,11 +48,8 @@ services:
|
||||
volumes:
|
||||
- meilisearch-data:/meili_data
|
||||
networks:
|
||||
- internal
|
||||
- kamal
|
||||
|
||||
# =========================
|
||||
# VOLUMES
|
||||
# =========================
|
||||
volumes:
|
||||
pgsql-data:
|
||||
external: true
|
||||
@@ -205,23 +58,10 @@ volumes:
|
||||
redis-data:
|
||||
name: bemeal_redis_data
|
||||
|
||||
storage-data:
|
||||
name: bemeal_storage_data
|
||||
|
||||
storage-public-data:
|
||||
name: bemeal_storage_public_data
|
||||
|
||||
meilisearch-data:
|
||||
name: bemeal_meilisearch_data
|
||||
|
||||
# =========================
|
||||
# NETWORKS
|
||||
# =========================
|
||||
networks:
|
||||
internal:
|
||||
name: bemeal_internal
|
||||
driver: bridge
|
||||
|
||||
public:
|
||||
kamal:
|
||||
external: true
|
||||
name: bemeal_public
|
||||
name: kamal
|
||||
|
||||
Reference in New Issue
Block a user