psql
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user