Files
lic/docker-compose.prod.yml
2026-04-21 18:05:15 -03:00

101 lines
2.4 KiB
YAML

services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USER:-licitatche}
POSTGRES_PASSWORD: ${DB_PASSWORD:-licitatche}
POSTGRES_DB: ${DB_NAME:-licitatche}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-licitatche}"]
interval: 5s
timeout: 5s
retries: 5
networks:
- internal
migrate:
image: migrate/migrate:v4.17.0
depends_on:
postgres:
condition: service_healthy
volumes:
- ./back-end/migrations:/migrations
command: [
"-path", "/migrations",
"-database", "postgres://${DB_USER:-licitatche}:${DB_PASSWORD:-licitatche}@postgres:5432/${DB_NAME:-licitatche}?sslmode=disable",
"up"
]
networks:
- internal
api:
build:
context: ./back-end
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
migrate:
condition: service_completed_successfully
environment:
APP_PORT: "8080"
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3000}
DB_HOST: postgres
DB_PORT: "5432"
DB_USER: ${DB_USER:-licitatche}
DB_PASSWORD: ${DB_PASSWORD:-licitatche}
DB_NAME: ${DB_NAME:-licitatche}
JWT_SECRET: ${JWT_SECRET}
JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
FILES_DIR: /app/data/files
volumes:
- api_files:/app/data/files
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/v1/editais", "-o", "/dev/null", "-s", "-w", "%{http_code}", "||", "true"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
- internal
front:
build:
context: ./front-end
args:
NUXT_PUBLIC_API_BASE: ${PUBLIC_API_BASE:-http://163.176.236.167:8080/api/v1}
restart: unless-stopped
depends_on:
- api
environment:
NUXT_PUBLIC_API_BASE: ${PUBLIC_API_BASE:-http://163.176.236.167:8080/api/v1}
ports:
- "3000:3000"
networks:
- internal
nginx:
image: nginx:alpine
restart: unless-stopped
depends_on:
- api
- front
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- internal
volumes:
postgres_data:
api_files:
networks:
internal:
driver: bridge