93 lines
2.6 KiB
YAML
93 lines
2.6 KiB
YAML
---
|
|
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:
|
|
- selfoss:/selfoss/data
|
|
deploy:
|
|
labels:
|
|
- traefik.enable=true
|
|
- traefik.docker.network=proxy
|
|
- traefik.http.routers.${STACK_NAME}-http.rule=Host(`${DOMAIN?Variable not set}`)
|
|
- traefik.http.routers.${STACK_NAME}-http.entrypoints=web
|
|
- traefik.http.routers.${STACK_NAME}-https.rule=Host(`${DOMAIN?Variable not set}`)
|
|
- traefik.http.routers.${STACK_NAME}-https.entrypoints=web-secure
|
|
- traefik.http.routers.${STACK_NAME}-https.tls=true
|
|
- traefik.http.routers.${STACK_NAME}-https.tls.certresolver=${LETS_ENCRYPT_ENV}
|
|
- traefik.http.services.${STACK_NAME}.loadbalancer.server.port=8888
|
|
update_config:
|
|
failure_action: rollback
|
|
order: start-first
|
|
environment:
|
|
- SELFOSS_USERNAME
|
|
- SELFOSS_PASSWORD
|
|
# TODO 3wc: call PHP password_hash() on this before loading it, see
|
|
# https://git.autonomic.zone/compose-stacks/selfoss/issues/3
|
|
#- 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
|
|
# TODO 3wc: see above note about issue #3
|
|
#- selfoss_password
|
|
entrypoint: /docker-entrypoint.sh
|
|
configs:
|
|
- source: entrypoint_conf
|
|
target: /docker-entrypoint.sh
|
|
mode: 0555
|
|
networks:
|
|
- proxy
|
|
- internal
|
|
depends_on:
|
|
- postgres
|
|
# TODO 3wc: not working currently, complains about YAML syntax error
|
|
#healthcheck:
|
|
# test: ["CMD", "wget", "-f" "http://localhost:8888"]
|
|
# interval: 30s
|
|
# timeout: 10s
|
|
# retries: 10
|
|
# start_period: 1m
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
internal:
|
|
|
|
volumes:
|
|
selfoss:
|
|
postgres:
|
|
|
|
secrets:
|
|
db_password:
|
|
external: true
|
|
name: ${STACK_NAME}_db_password_${DB_PASSWORD_VERSION}
|
|
# TODO 3wc: see above note about issue #3
|
|
#selfoss_password:
|
|
# external: true
|
|
# name: ${STACK_NAME}_selfoss_password_${SELFOSS_PASSWORD_VERSION}
|
|
|
|
configs:
|
|
entrypoint_conf:
|
|
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION}
|
|
file: entrypoint.sh.tmpl
|
|
template_driver: golang
|