This commit is contained in:
Andrey Kondratev
2025-08-28 19:13:39 +05:00
parent 6cb8341075
commit 7a7a189ef7
6 changed files with 217 additions and 854 deletions

View File

@@ -32,6 +32,26 @@ services:
networks:
- quixotic
# PostgreSQL database
postgres:
image: postgres:15-alpine
container_name: quixotic-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-quixotic}
POSTGRES_USER: ${POSTGRES_USER:-quixotic}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-quixotic123}
volumes:
- postgres-data:/var/lib/postgresql/data
- ./database/init:/docker-entrypoint-initdb.d
networks:
- quixotic
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-quixotic}"]
interval: 5s
timeout: 5s
retries: 5
# Main application
quixotic-app:
build:
@@ -42,9 +62,9 @@ services:
environment:
- NODE_ENV=production
- PORT=3000
- DATABASE_URL=postgresql://${POSTGRES_USER:-quixotic}:${POSTGRES_PASSWORD:-quixotic123}@postgres:5432/${POSTGRES_DB:-quixotic}
volumes:
- downloads:/app/downloads
- ./database:/app/database
labels:
- "traefik.enable=true"
- "traefik.http.routers.quixotic.rule=Host(`${DOMAIN:-localhost}`)"
@@ -59,12 +79,14 @@ services:
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
depends_on:
- traefik
- postgres
networks:
- quixotic
volumes:
traefik-ssl-certs:
downloads:
postgres-data:
networks:
quixotic: