first commit
This commit is contained in:
99
docker-stack.yml
Normal file
99
docker-stack.yml
Normal file
@@ -0,0 +1,99 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: postgres:15
|
||||
environment:
|
||||
POSTGRES_DB: syntria_db
|
||||
POSTGRES_USER: syntria_user
|
||||
POSTGRES_PASSWORD: syntria_secure_2024
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- syntria_network
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
placement:
|
||||
constraints: [node.role == manager]
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U syntria_user -d syntria_db"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
image: dymai/syntria-backend:latest
|
||||
environment:
|
||||
DATABASE_URL: postgresql://syntria_user:syntria_secure_2024@db:5432/syntria_db
|
||||
SECRET_KEY: tu_clave_secreta_super_segura_minimo_32_caracteres_prod
|
||||
OPENAI_API_KEY: tu_api_key_de_openai
|
||||
GEMINI_API_KEY: tu_api_key_de_gemini
|
||||
ENVIRONMENT: production
|
||||
ALLOWED_ORIGINS: http://localhost,https://syntria.tudominio.com
|
||||
networks:
|
||||
- syntria_network
|
||||
- network_public
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 2
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 10s
|
||||
order: start-first
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=network_public"
|
||||
- "traefik.http.routers.syntria-api.rule=Host(`syntria.tudominio.com`) && PathPrefix(`/api`)"
|
||||
- "traefik.http.routers.syntria-api.entrypoints=websecure"
|
||||
- "traefik.http.routers.syntria-api.tls.certresolver=letsencryptresolver"
|
||||
- "traefik.http.routers.syntria-api.service=syntria-api"
|
||||
- "traefik.http.services.syntria-api.loadbalancer.server.port=8000"
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
|
||||
|
||||
frontend:
|
||||
image: dymai/syntria-frontend:latest
|
||||
networks:
|
||||
- syntria_network
|
||||
- network_public
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 2
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 10s
|
||||
order: start-first
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=network_public"
|
||||
- "traefik.http.routers.syntria-web.rule=Host(`syntria.tudominio.com`)"
|
||||
- "traefik.http.routers.syntria-web.entrypoints=websecure"
|
||||
- "traefik.http.routers.syntria-web.priority=1"
|
||||
- "traefik.http.routers.syntria-web.tls.certresolver=letsencryptresolver"
|
||||
- "traefik.http.routers.syntria-web.service=syntria-web"
|
||||
- "traefik.http.services.syntria-web.loadbalancer.server.port=80"
|
||||
|
||||
networks:
|
||||
syntria_network:
|
||||
driver: overlay
|
||||
attachable: true
|
||||
network_public:
|
||||
external: true
|
||||
attachable: true
|
||||
name: network_public
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
Reference in New Issue
Block a user