Mejorando configuracion de stacks usando traefik
This commit is contained in:
133
stacks/moka/moka.yml
Normal file
133
stacks/moka/moka.yml
Normal file
@@ -0,0 +1,133 @@
|
||||
services:
|
||||
moka:
|
||||
image: git.skrd.fun/skrd/moka:v0.3.9.1
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- SERVICE=server
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=traefik"
|
||||
- "traefik.http.routers.moka.rule=Host(`moka.skrd.fun`)"
|
||||
- "traefik.http.routers.moka.entrypoints=websecure"
|
||||
- "traefik.http.routers.moka.tls.certresolver=cf"
|
||||
- "traefik.http.services.moka.loadbalancer.server.port=80"
|
||||
- "traefik.http.routers.moka.middlewares=redirect-to-https@file"
|
||||
volumes:
|
||||
- /srv/dev-disk-by-uuid-1582b800-1f82-407a-a3aa-3460b3390127/docker/moka:/app/storage
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
- proxy
|
||||
init: true
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD-SHELL", "curl -fsS http://localhost:80/up >/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
|
||||
start_period: 20s
|
||||
|
||||
schedule:
|
||||
image: git.skrd.fun/skrd/moka:v0.3.9.1
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- SERVICE=schedule
|
||||
volumes:
|
||||
- /srv/dev-disk-by-uuid-1582b800-1f82-407a-a3aa-3460b3390127/docker/moka:/app/storage
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
init: true
|
||||
healthcheck:
|
||||
test:
|
||||
["CMD-SHELL", "pgrep -f 'artisan schedule:work' >/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
|
||||
queue:
|
||||
image: git.skrd.fun/skrd/moka:v0.3.9.1
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- SERVICE=queue
|
||||
volumes:
|
||||
- /srv/dev-disk-by-uuid-1582b800-1f82-407a-a3aa-3460b3390127/docker/moka:/app/storage
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
pgsql:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- internal
|
||||
init: true
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pgrep -f 'artisan queue:work' >/dev/null || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
|
||||
redis:
|
||||
image: redis:alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
networks:
|
||||
- internal
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "redis-cli -h 127.0.0.1 ping | grep -q PONG"]
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 5s
|
||||
|
||||
pgsql:
|
||||
image: "postgres:18"
|
||||
restart: unless-stopped
|
||||
shm_size: 128mb
|
||||
environment:
|
||||
PGPASSWORD: "${DB_PASSWORD:-secret}"
|
||||
POSTGRES_DB: "${DB_DATABASE}"
|
||||
POSTGRES_USER: "${DB_USERNAME}"
|
||||
POSTGRES_PASSWORD: "${DB_PASSWORD:-secret}"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- internal
|
||||
init: true
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -h 127.0.0.1 -p 5432 -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-postgres}",
|
||||
]
|
||||
interval: 3s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
internal:
|
||||
name: moka
|
||||
proxy:
|
||||
name: traefik
|
||||
external: true
|
||||
Reference in New Issue
Block a user