- Agregada configuración de servidor HTTPS con Express (server.js) - Integración de PostgreSQL en docker-compose.yml con servicio dedicado - Actualizado Dockerfile para optimizar build en Alpine Linux - Configurado vite.config.ts con soporte HTTPS para desarrollo - Agregados certificados SSL para HTTPS - Actualizado svelte.config.js con configuración CSRF - Ajustadas métricas de restauración en +page.server.ts para usar last_restore_date - Agregado script npm start en package.json - Instalado express como dependencia de producción
79 lines
2.2 KiB
YAML
79 lines
2.2 KiB
YAML
services:
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
# Use host.docker.internal to access resources on the host machine
|
|
- DB_PRIMARY_HOST=host.docker.internal
|
|
- DB_PRIMARY_USER=${DB_PRIMARY_USER}
|
|
- DB_PRIMARY_PASS=${DB_PRIMARY_PASS}
|
|
- DB_PRIMARY_DB=${DB_PRIMARY_DB}
|
|
|
|
- DB_SECONDARY_HOST=host.docker.internal
|
|
- DB_SECONDARY_USER=${DB_SECONDARY_USER}
|
|
- DB_SECONDARY_PASS=${DB_SECONDARY_PASS}
|
|
- DB_SECONDARY_DB=${DB_SECONDARY_DB}
|
|
|
|
- DB_AZURE_HOST=${DB_AZURE_HOST}
|
|
- DB_AZURE_USER=${DB_AZURE_USER}
|
|
- DB_AZURE_PASS=${DB_AZURE_PASS}
|
|
- DB_AZURE_DB=${DB_AZURE_DB}
|
|
|
|
# PostgreSQL connection (connect to postgres service)
|
|
- DB_POSTGRES_HOST=postgres
|
|
- DB_POSTGRES_PORT=5432
|
|
- DB_POSTGRES_USER=${DB_POSTGRES_USER}
|
|
- DB_POSTGRES_PASS=${DB_POSTGRES_PASS}
|
|
- DB_POSTGRES_DB=${DB_POSTGRES_DB}
|
|
|
|
# JWT Secret
|
|
- JWT_SECRET=${JWT_SECRET}
|
|
|
|
# Use a mounted volume for backups
|
|
- BACKUP_PATH=/data/backups
|
|
|
|
- PORT=3000
|
|
- ORIGIN=https://localhost:3000
|
|
- NODE_ENV=production
|
|
volumes:
|
|
# Map the actual backup folder from host to the container's backup path
|
|
# Windows path D:/BackupSFTP/ mapped to /data/backups inside container (read-only)
|
|
- D:/BackupSFTP:/data/backups:ro
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
depends_on:
|
|
- postgres
|
|
networks:
|
|
- aduanasoft-network
|
|
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: aduanasoft-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${DB_POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${DB_POSTGRES_PASS}
|
|
POSTGRES_DB: ${DB_POSTGRES_DB}
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- aduanasoft-network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
|
|
networks:
|
|
aduanasoft-network:
|
|
driver: bridge
|