update: wishlist docker compose file
This commit is contained in:
@@ -1,41 +1,61 @@
|
|||||||
services:
|
services:
|
||||||
db:
|
database:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
container_name: wishlist-db
|
container_name: wishlist-postgres
|
||||||
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: wishlistuser
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: wishlistpassword
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
POSTGRES_DB: wishlist
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
ports:
|
|
||||||
- "5432:5432"
|
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- /mnt/HC_Volume_102830676/wishlist:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U wishlistuser -d wishlist"]
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
networks:
|
||||||
|
- wishlist-net
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: wishlist-app
|
container_name: wishlist-app
|
||||||
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgresql://wishlistuser:wishlistpassword@db:5432/wishlist
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database:5432/${POSTGRES_DB}
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
PORT: 3000
|
PORT: 3000
|
||||||
AUTH_SECRET: ${AUTH_SECRET:-change-me-in-production}
|
AUTH_SECRET: ${AUTH_SECRET}
|
||||||
AUTH_URL: ${AUTH_URL:-http://localhost:3000}
|
AUTH_URL: ${AUTH_URL}
|
||||||
AUTH_TRUST_HOST: true
|
AUTH_TRUST_HOST: "true"
|
||||||
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
|
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-}
|
||||||
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
|
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-}
|
||||||
ports:
|
AUTHENTIK_CLIENT_ID: ${AUTHENTIK_CLIENT_ID:-}
|
||||||
- "3000:3000"
|
AUTHENTIK_CLIENT_SECRET: ${AUTHENTIK_CLIENT_SECRET:-}
|
||||||
|
AUTHENTIK_ISSUER: ${AUTHENTIK_ISSUER:-}
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
database:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: unless-stopped
|
networks:
|
||||||
|
- wishlist-net
|
||||||
|
- traefik-net
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.docker.network=traefik-net
|
||||||
|
# HTTPS router
|
||||||
|
- traefik.http.routers.wishlist.rule=Host(`wish.rasmusq.com`)
|
||||||
|
- traefik.http.routers.wishlist.entrypoints=websecure
|
||||||
|
- traefik.http.routers.wishlist.tls.certresolver=letsencrypt
|
||||||
|
# Forward headers for Auth.js
|
||||||
|
- traefik.http.routers.wishlist.middlewares=wishlist-headers
|
||||||
|
- traefik.http.middlewares.wishlist-headers.headers.customRequestHeaders.X-Forwarded-Proto=https
|
||||||
|
- traefik.http.middlewares.wishlist-headers.headers.customRequestHeaders.X-Forwarded-Host=wish.rasmusq.com
|
||||||
|
- traefik.http.services.wishlist.loadbalancer.server.port=3000
|
||||||
|
|
||||||
volumes:
|
networks:
|
||||||
postgres_data:
|
wishlist-net:
|
||||||
|
name: wishlist-net
|
||||||
|
traefik-net:
|
||||||
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user