Files
main_backend/docker-compose.dev.yml
Daniil 97705a23df
dev / deploy (push) Failing after 1m27s
chore: add pipeline
2026-04-29 23:48:19 +03:00

68 lines
1.5 KiB
YAML

x-backend: &backend
image: cofee-backend:dev
build:
context: .
dockerfile: Dockerfile
target: prod
env_file:
- .env
restart: unless-stopped
volumes:
- ~/srv/storage/cofee_backend_api/.certs:/app/.certs:ro
- ~/srv/storage/cofee_backend_api/.artifacts:/app/.artifacts
networks:
- services_local
services:
api:
<<: *backend
container_name: cofee_backend_api
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.cofee-backend.rule=Host(`api.trimgu.ru`)"
- "traefik.http.routers.cofee-backend.entrypoints=websecure"
- "traefik.http.routers.cofee-backend.service=cofee-backend"
- "traefik.http.services.cofee-backend.loadbalancer.server.port=8000"
networks:
- services_local
- proxy
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request;
urllib.request.urlopen('http://localhost:8000/api/health/')",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
worker:
<<: *backend
container_name: cofee_backend_worker
command:
[
"dramatiq",
"cpv3.modules.tasks.service",
"--processes",
"1",
"--threads",
"2",
]
healthcheck:
test: [ "CMD-SHELL", "pgrep -f dramatiq || exit 1" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
networks:
services_local:
external: true
proxy:
external: true