65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
services:
|
|
qnote-psql:
|
|
image: postgres:16-alpine
|
|
container_name: qnote-psql
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
|
|
start_period: 20s
|
|
interval: 30s
|
|
retries: 5
|
|
timeout: 5s
|
|
volumes:
|
|
- ${PWD}/data:/var/lib/postgresql/data
|
|
networks:
|
|
- qnote
|
|
environment:
|
|
POSTGRES_USER: ${PG_USER:-qnote}
|
|
POSTGRES_PASSWORD: ${PG_PASS:?db password required}
|
|
POSTGRES_DB: ${PG_DB:-qnote}
|
|
|
|
qnote-server:
|
|
container_name: qnote-server
|
|
build:
|
|
context: ${PWD}/server
|
|
dockerfile: ${PWD}/server/Dockerfile
|
|
image: qnote-server:latest
|
|
networks:
|
|
- qnote
|
|
depends_on:
|
|
qnote-psql:
|
|
condition: service_healthy
|
|
environment:
|
|
JWT_SECRET: ${JWT_SECRET:?jwt secret required}
|
|
DB_URL: postgres://${PG_USER:-qnote}:${PG_PASS:?db password required}@qnote-psql/${PG_DB:-qnote}?sslmode=disable
|
|
CSRF_SECRET: ${CSRF_SECRET:?csrf secret required}
|
|
ADMIN_USERNAME: ${ADMIN_USERNAME:?init admin username required}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?init admin password required}
|
|
LOG_LEVEL: ${LOG_LEVEL:-info}
|
|
APP_ENV: ${APP_ENV:-production}
|
|
DOMAIN: ${DOMAIN:-localhost}
|
|
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
|
|
|
|
qnote-web:
|
|
container_name: qnote-web
|
|
build:
|
|
context: ${PWD}/web
|
|
dockerfile: ${PWD}/web/Dockerfile
|
|
image: qnote-web:latest
|
|
networks:
|
|
- qnote
|
|
# Add potential reverse proxy's local network here
|
|
ports:
|
|
- 3000:80 # Container port defined in nginx.conf (bound to 3000 for dev.)
|
|
depends_on:
|
|
- qnote-server
|
|
environment:
|
|
VITE_VIEW_COOKIE_PATH: ${VITE_VIEW_COOKIE_PATH:-/}
|
|
VITE_VIEW_COOKIE_DOMAIN: ${DOMAIN:-localhost}
|
|
VITE_COOKIE_SAME_SITE: ${VITE_COOKIE_SAME_SITE:-strict}
|
|
|
|
networks:
|
|
qnote:
|
|
external: false
|
|
name: qnote
|