Add docker-compose configuration for backend and frontend

This commit is contained in:
nogueiragustavo
2026-02-26 19:41:27 -03:00
committed by GitHub
parent 86ee587be7
commit 3a8e8a5d54

46
docker-compose.yml Normal file
View File

@@ -0,0 +1,46 @@
version: "3.8"
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: oci-agent-backend
restart: unless-stopped
environment:
- APP_SECRET=${APP_SECRET:-change-me-in-production-use-a-long-random-string}
- JWT_EXPIRY_HOURS=${JWT_EXPIRY_HOURS:-12}
- DATA_DIR=/data
volumes:
- agent-data:/data
ports:
- "8000:8000"
networks:
- agent-net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 3
frontend:
image: nginx:alpine
container_name: oci-agent-frontend
restart: unless-stopped
volumes:
- ./frontend/index.html:/usr/share/nginx/html/index.html:ro
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "${PORT:-8080}:80"
depends_on:
- backend
networks:
- agent-net
volumes:
agent-data:
driver: local
networks:
agent-net:
driver: bridge