feat: Configuración completa de Docker con PostgreSQL, HTTPS y servidor de producción
- 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
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
@@ -22,13 +20,59 @@ services:
|
||||
- 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=http://localhost:3000
|
||||
- ORIGIN=https://localhost:3000
|
||||
- NODE_ENV=production
|
||||
volumes:
|
||||
# Map a local folder to the container's backup path
|
||||
- ./backups:/data/backups:ro
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user