Initial import

This commit is contained in:
3wc 2021-07-25 13:52:51 +02:00
commit e3c7b09c22
2 changed files with 118 additions and 0 deletions

28
README.md Normal file
View File

@ -0,0 +1,28 @@
# discourse
${REPO_DESCRIPTION}
<!-- metadata -->
* **Category**:
* **Status**:
* **Image**: [`discourse`](https://hub.docker.com/r/discourse/discourse)
* **Healthcheck**:
* **Backups**:
* **Email**:
* **Tests**:
* **SSO**:
<!-- endmetadata -->
## Basic usage
1. Set up Docker Swarm and [`abra`]
2. Deploy [`coop-cloud/traefik`]
3. `abra app new discourse --secrets` (optionally with `--pass` if you'd like
to save secrets in `pass`)
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy`
6. Open the configured domain in your browser to finish set-up
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik

90
compose.yml Normal file
View File

@ -0,0 +1,90 @@
---
version: "3.8"
services:
app:
image: bitnami/discourse:2.7.7
networks:
- proxy
- internal
# entrypoint: ['tail', '-f', '/dev/null']
environment:
- ALLOW_EMPTY_PASSWORD=yes
- DISCOURSE_HOST=${DOMAIN}
- DISCOURSE_DATABASE_HOST=db
- DISCOURSE_DATABASE_USER=discourse
- DISCOURSE_DATABASE_NAME=discourse
- DISCOURSE_REDIS_HOST=redis
- DISCOURSE_REDIS_PORT_NUMBER=6379
volumes:
- 'discourse_data:/bitnami/discourse'
depends_on:
- db
- redis
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
## Redirect from EXTRA_DOMAINS to DOMAIN
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
db:
image: postgres:11-alpine
networks:
- internal
volumes:
- 'postgresql_data:/var/lib/postgresql/data'
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_USER=discourse
- POSTGRES_DB=discourse
redis:
image: redis:6.0-alpine
networks:
- internal
volumes:
- 'redis_data:/data'
sidekiq:
image: bitnami/discourse:2.7.7
networks:
- internal
depends_on:
- discourse
volumes:
- 'sidekiq_data:/bitnami/discourse'
command: /opt/bitnami/scripts/discourse-sidekiq/run.sh
environment:
- ALLOW_EMPTY_PASSWORD=yes
- DISCOURSE_HOST=${DOMAIN}
- DISCOURSE_DATABASE_HOST=db
- DISCOURSE_DATABASE_PORT_NUMBER=5432
- DISCOURSE_DATABASE_USER=discourse
- DISCOURSE_DATABASE_NAME=discourse
- DISCOURSE_REDIS_HOST=redis
- DISCOURSE_REDIS_PORT_NUMBER=6379
volumes:
postgresql_data:
redis_data:
discourse_data:
sidekiq_data:
networks:
proxy:
external: true
internal: