Split postgres config

This commit is contained in:
3wc 2020-09-23 16:57:11 +02:00
parent caa94f4d69
commit 5f2ce168c4
3 changed files with 41 additions and 28 deletions

View File

@ -6,8 +6,9 @@ export LETS_ENCRYPT_ENV=production
# Selfoss options, see https://www.selfoss.aditu.de/#configuration
# Options are sqlite, pgsql, mysql; currently sqlite and pgsql are supported
# If you choose pgsql
# If you choose pgsql, uncomment the COMPOSE_FILE line
export SELFOSS_DB_TYPE=sqlite
#export COMPOSE_FILE="compose.yml:compose.postgres.yml"
# Set these two variables to enable authentication
export SELFOSS_USERNAME=

37
compose.postgres.yml Normal file
View File

@ -0,0 +1,37 @@
---
version: '3.8'
services:
postgres:
image: "postgres:9.6.5"
volumes:
- "postgres:/var/lib/postgresql/data"
networks:
- internal
environment:
POSTGRES_USER: selfoss
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
POSTGRES_DB: selfoss
secrets:
- db_password
selfoss:
networks:
- internal
depends_on:
- postgres
secrets:
- db_password
environment:
- SELFOSS_DB_HOST=postgres
- SELFOSS_DB_NAME=selfoss
- SELFOSS_DB_USERNAME=selfoss
- SELFOSS_DB_PASSWORD_FILE=/run/secrets/db_password
volumes:
postgres:
secrets:
db_password:
external: true
name: ${STACK_NAME}_db_password_${DB_PASSWORD_VERSION}

View File

@ -2,19 +2,6 @@
version: '3.8'
services:
postgres:
image: "postgres:9.6.5"
volumes:
- "postgres:/var/lib/postgresql/data"
networks:
- internal
environment:
POSTGRES_USER: selfoss
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
POSTGRES_DB: selfoss
secrets:
- db_password
selfoss:
image: akito13/selfoss
volumes:
@ -41,12 +28,7 @@ services:
#- SELFOSS_PASSWORD_FILE=/run/secrets/selfoss_password
- SELFOSS_DB_TYPE
- SELFOSS_LOGGER_LEVEL
- SELFOSS_DB_HOST=postgres
- SELFOSS_DB_NAME=selfoss
- SELFOSS_DB_USERNAME=selfoss
- SELFOSS_DB_PASSWORD_FILE=/run/secrets/db_password
secrets:
- db_password
#secrets:
# TODO 3wc: see above note about issue #3
#- selfoss_password
entrypoint: /docker-entrypoint.sh
@ -56,9 +38,6 @@ services:
mode: 0555
networks:
- proxy
- internal
depends_on:
- postgres
healthcheck:
test: ["CMD", "wget", "-qO", "-", "http://localhost:8888"]
interval: 30s
@ -73,12 +52,8 @@ networks:
volumes:
selfoss:
postgres:
secrets:
db_password:
external: true
name: ${STACK_NAME}_db_password_${DB_PASSWORD_VERSION}
#secrets:
# TODO 3wc: see above note about issue #3
#selfoss_password:
# external: true