qnote/docker-compose.yml

58 lines
1.6 KiB
YAML

services:
notatest-psql:
image: postgres:16-alpine
container_name: notatest-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:
- notatest
environment:
POSTGRES_USER: ${PG_USER:-notatest}
POSTGRES_PASSWORD: ${PG_PASS:?db password required}
POSTGRES_DB: ${PG_DB:-notatest}
notatest-server:
container_name: notatest-server
build:
context: ${PWD}/server
dockerfile: ${PWD}/server/Dockerfile
image: notatest-server:latest
networks:
- notatest
depends_on:
notatest-psql:
condition: service_healthy
environment:
JWT_SECRET: ${JWT_SECRET:?jwt secret required}
DB_URL: postgres://${PG_USER:-notatest}:${PG_PASS:?db password required}@notatest-psql/${PG_DB:-notatest}?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:5173}
notatest-web:
build: ${PWD}/web
image: notatest/web
container_name: notatest-web
networks:
- notatest
ports:
- 3000:80 # Defined in nginx.conf
depends_on:
- notatest-server
networks:
notatest:
external: false
name: notatest