Bootstrap initial admin via env and add compose profiles

This commit is contained in:
2026-03-17 19:16:25 +03:00
parent 3b22133d7a
commit 78f1e6803f
4 changed files with 88 additions and 9 deletions

View File

@@ -1,7 +1,6 @@
services:
db:
image: ${POSTGRES_IMAGE:-postgres:16-alpine}
container_name: ss_tools_db
restart: unless-stopped
environment:
POSTGRES_DB: ss_tools
@@ -21,7 +20,6 @@ services:
build:
context: .
dockerfile: docker/backend.Dockerfile
container_name: ss_tools_backend
restart: unless-stopped
env_file:
- ./backend/.env
@@ -34,6 +32,9 @@ services:
TASKS_DATABASE_URL: postgresql+psycopg2://postgres:postgres@db:5432/ss_tools
AUTH_DATABASE_URL: postgresql+psycopg2://postgres:postgres@db:5432/ss_tools
BACKEND_PORT: 8000
INITIAL_ADMIN_CREATE: ${INITIAL_ADMIN_CREATE:-false}
INITIAL_ADMIN_USERNAME: ${INITIAL_ADMIN_USERNAME:-admin}
INITIAL_ADMIN_PASSWORD: ${INITIAL_ADMIN_PASSWORD:-}
ports:
- "${BACKEND_HOST_PORT:-8001}:8000"
volumes:
@@ -46,7 +47,6 @@ services:
build:
context: .
dockerfile: docker/frontend.Dockerfile
container_name: ss_tools_frontend
restart: unless-stopped
depends_on:
- backend