root: make docker-compose database name and username configurable

This commit is contained in:
Jens Langhammer 2020-12-14 12:27:33 +01:00
parent 9f2e9e8444
commit 8bbb854073
2 changed files with 13 additions and 2 deletions

View File

@ -10,8 +10,8 @@ services:
- internal - internal
environment: environment:
- POSTGRES_PASSWORD=${PG_PASS:-thisisnotagoodpassword} - POSTGRES_PASSWORD=${PG_PASS:-thisisnotagoodpassword}
- POSTGRES_USER=authentik - POSTGRES_USER=${PG_USER:-authentik}
- POSTGRES_DB=authentik - POSTGRES_DB=${PG_DB:-authentik}
env_file: env_file:
- .env - .env
redis: redis:
@ -24,6 +24,8 @@ services:
environment: environment:
AUTHENTIK_REDIS__HOST: redis AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
volumes: volumes:
- ./media:/media - ./media:/media
@ -49,6 +51,8 @@ services:
environment: environment:
AUTHENTIK_REDIS__HOST: redis AUTHENTIK_REDIS__HOST: redis
AUTHENTIK_POSTGRESQL__HOST: postgresql AUTHENTIK_POSTGRESQL__HOST: postgresql
AUTHENTIK_POSTGRESQL__USER: ${PG_USER:-authentik}
AUTHENTIK_POSTGRESQL__NAME: ${PG_DB:-authentik}
AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS} AUTHENTIK_POSTGRESQL__PASSWORD: ${PG_PASS}
volumes: volumes:
- ./backups:/backups - ./backups:/backups

View File

@ -35,6 +35,13 @@ If you decided to rename the folder you're running the docker-compose file from,
The only manual change you have to do is replace the `PASSBOOK_` prefix in your `.env` file, so `PASSBOOK_SECRET_KEY` gets changed to `AUTHENTIK_SECRET_KEY`. The only manual change you have to do is replace the `PASSBOOK_` prefix in your `.env` file, so `PASSBOOK_SECRET_KEY` gets changed to `AUTHENTIK_SECRET_KEY`.
Additionally, the database name and username have to be changed, so add this block to your `.env` file:
```
PG_USER=passbook
PG_DB=passbook
```
Afterwards, you can simply run `docker-compose up -d` and then the normal upgrade command of `docker-compose run --rm server migrate`. Afterwards, you can simply run `docker-compose up -d` and then the normal upgrade command of `docker-compose run --rm server migrate`.
### Kubernetes ### Kubernetes