- Updated .env.example to consolidate SQL Server credentials under PANEL_MSSQL_* variables. - Removed deprecated docker-compose.postgres.yml file. - Adjusted docker-compose.yml to utilize new SQL Server credential structure. - Enhanced README.md with Docker build and push instructions. - Refined database schema in schema.sql to align with new user and permission structures. - Updated init-database.js to reflect changes in user and session table names. - Modified user management functions in users.ts to accommodate new database schema. - Streamlined API routes to utilize PostgreSQL for user and database management. - Improved error handling and logging in various server routes.
70 lines
2.0 KiB
YAML
70 lines
2.0 KiB
YAML
services:
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
# Use host.docker.internal to access resources on the host machine
|
|
# SQL Server: credenciales globales (server_name / database_name vienen de a24c.database_nodes en Postgres)
|
|
- PANEL_MSSQL_USER=${PANEL_MSSQL_USER}
|
|
- PANEL_MSSQL_PASSWORD=${PANEL_MSSQL_PASSWORD}
|
|
- PANEL_MSSQL_DOCKER=${PANEL_MSSQL_DOCKER:-true}
|
|
- IN_DOCKER=true
|
|
|
|
# PostgreSQL: catálogo ControlDesk (a24c.*) + usuarios del panel
|
|
- 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
|