diff --git a/.envrc.sample b/.envrc.sample index 4495759..a98d081 100644 --- a/.envrc.sample +++ b/.envrc.sample @@ -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= diff --git a/compose.postgres.yml b/compose.postgres.yml new file mode 100644 index 0000000..c5917a3 --- /dev/null +++ b/compose.postgres.yml @@ -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} diff --git a/compose.yml b/compose.yml index 3e85fe3..6cea6e3 100644 --- a/compose.yml +++ b/compose.yml @@ -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