feat: Update environment variables and Docker configurations for production setup

This commit is contained in:
AlexeerCT
2025-12-31 10:37:23 -06:00
parent 17c7a5ecd1
commit 97b3ea52bc
8 changed files with 56 additions and 20 deletions

View File

@@ -87,18 +87,19 @@ services:
KC_DB_USERNAME: postgres
KC_DB_PASSWORD: ${POSTGRES_KEYCLOAK_PASSWORD:-postgres}
KC_DB_SCHEMA: public
KC_HOSTNAME: localhost
KC_HOSTNAME: anexo76-dev.aduanasoft.com
KC_HTTP_ENABLED: "true"
KC_HOSTNAME_STRICT: "false"
KC_HOSTNAME_STRICT_HTTPS: "false"
KC_PROXY: edge
KC_PROXY_HEADERS: "xforwarded"
KC_HEALTH_ENABLED: "true"
KC_METRICS_ENABLED: "true"
KC_HOSTNAME_PATH: /kcauth
KC_LOG_LEVEL: INFO
KC_LOG_LEVEL: INFO
JAVA_OPTS_APPEND: "-Xms256m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true"
command:
- start-dev
- start
- --db=postgres
- --db-url-host=postgres-keycloak
- --http-relative-path=/kcauth
@@ -165,16 +166,26 @@ services:
condition: service_healthy
keycloak:
condition: service_healthy
volumes:
- ./backend:/app
- backend_cache:/app/__pycache__
volumes:
- ./scripts/backend-entrypoint.sh:/entrypoint.sh:ro
networks:
- backend-net
- frontend-net
restart: unless-stopped
entrypoint: ["/entrypoint.sh"]
command: ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload", "--log-level", "info"]
command:
[
"gunicorn",
"main:app",
"-k",
"uvicorn.workers.UvicornWorker",
"-w",
"${WEB_CONCURRENCY:-4}",
"-b",
"0.0.0.0:8000",
"--log-level",
"info"
]
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/api/health || exit 1"]
interval: 15s
@@ -195,13 +206,7 @@ services:
# Frontend - SvelteKit
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.prod
args:
- BUILDKIT_INLINE_CACHE=1
- VITE_API_URL=https://anexo76-dev.aduanasoft.com/api/
- VITE_KEYCLOAK_URL=https://anexo76-dev.aduanasoft.com/kcauth/
image: dev.aduanasoft.com/anexo76/frontend:latest
container_name: anexo76-frontend
environment:
- NODE_ENV=${NODE_ENV:-development}
@@ -213,7 +218,7 @@ services:
- KEYCLOAK_URL=${KEYCLOAK_URL:-http://keycloak:8080/kcauth}
- KEYCLOAK_REALM=${KEYCLOAK_REALM:-master}
- KEYCLOAK_CLIENT_ID=${KEYCLOAK_CLIENT_ID:-anexo76-backend}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET:-zRU5NuvUFtBSOuh7Kdc372AItoWGLgz9}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET:-dev-secret}
ports:
- "5111:5173"
depends_on:
@@ -226,7 +231,7 @@ services:
- frontend-net
- auth-net
restart: unless-stopped
command: ["node", "build"]
command: ["pnpm", "start"]
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5173/ || exit 1"]
interval: 15s