From 5edfb87d3b2c6790bd1f064c20ce7e1c66ea9e92 Mon Sep 17 00:00:00 2001 From: ae Date: Thu, 10 Apr 2025 21:34:40 +0300 Subject: [PATCH] build: up-to-date docker compose --- .env.template | 11 ++++++++++- .gitignore | 1 + docker-compose.yml | 36 ++++++++++++++++-------------------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.env.template b/.env.template index 07f4198..b0b9172 100644 --- a/.env.template +++ b/.env.template @@ -1,3 +1,5 @@ +# shellcheck disable=all + # Database PG_USER="" PG_PASS="" @@ -5,4 +7,11 @@ PG_DB="" # Server JWT_SECRET="" -LOG_LEVEL="debug" +CSRF_SECRET="" # Should be 32 bytes long +ADMIN_USERNAME="" +ADMIN_PASSWORD="" +LOG_LEVEL="info" +APP_ENV="production" +DOMAIN="" +FRONTEND_URL="" + diff --git a/.gitignore b/.gitignore index b226766..b838d10 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +data/ TASKS.md .env diff --git a/docker-compose.yml b/docker-compose.yml index 5622bf0..f516117 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,8 +10,7 @@ services: retries: 5 timeout: 5s volumes: - # Alternatively mount to disk -> ${PWD}/data - - notatest-data:/var/lib/postgresql/data + - ${PWD}/data:/var/lib/postgresql/data networks: - notatest environment: @@ -27,35 +26,32 @@ services: image: notatest-server:latest networks: - notatest - ports: - - 8080:8080 # TODO: remove forwarding after testing 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 - LOG_LEVEL: ${LOG_LEVEL:-info} + 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: - # - 3030:3030 - # depends_on: - # notatest-psql: - # condition: service_healthy - # notatest-server: + 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 - -volumes: - notatest-data: