chore: use compose secrets by default

This commit is contained in:
Ferdinand Mütsch
2024-09-27 14:49:15 +02:00
parent dcd36db410
commit b6def215c5
5 changed files with 42 additions and 56 deletions

View File

@@ -3,25 +3,43 @@ services:
build: .
ports:
- 3000:3000
restart: always
restart: unless-stopped
environment:
# See README.md and config.default.yml for all config options
WAKAPI_DB_TYPE: "postgres"
WAKAPI_DB_NAME: "wakapi"
WAKAPI_DB_USER: "wakapi"
WAKAPI_DB_PASSWORD: "choose-a-password"
WAKAPI_DB_HOST: "db"
WAKAPI_DB_PORT: "5432"
ENVIRONMENT: "prod"
WAKAPI_DB_PASSWORD_FILE: "/run/secrets/db_password" # alternatively, set WAKAPI_DB_PASSWORD directly without the use of secrets
WAKAPI_PASSWORD_SALT_FILE: "/run/secrets/password_salt" # alternatively, set WAKAPI_PASSWORD_SALT directly without the use of secrets
WAKAPI_MAIL_SMTP_PASS_FILE: "/run/secrets/smtp_pass" # alternatively, set WAKAPI_MAIL_SMTP_PASS directly without the use of secrets
secrets:
- password_salt
- smtp_pass
- db_password
db:
image: postgres:12.3
restart: unless-stopped
environment:
POSTGRES_USER: "wakapi"
POSTGRES_PASSWORD: "choose-a-password"
POSTGRES_PASSWORD_FILE: "/run/secrets/db_password" # alternatively, set POSTGRES_PASSWORD directly without the use of secrets
POSTGRES_DB: "wakapi"
volumes:
- wakapi-db-data:/var/lib/postgresql/data
secrets:
- db_password
# secrets can be defined either from a local file or from an environment variable defined on the client host (the one that runs `docker compose` command)
# see https://docs.docker.com/compose/how-tos/use-secrets/ for details
secrets:
password_salt:
environment: WAKAPI_PASSWORD_SALT
smtp_pass:
environment: WAKAPI_SMTP_PASS
db_password:
environment: WAKAPI_DB_PASSWORD
volumes:
wakapi-db-data: {}