Files
umap/compose.yml
2026-01-24 16:03:50 -05:00

118 lines
3.4 KiB
YAML

---
services:
proxy:
image: nginx:1.29.4
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "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}"
# Edit the following line if you are using one, but not both, "Redirect" sections below
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirectscheme,${STACK_NAME}-redirecthostname"
# Redirect from EXTRA_DOMAINS to DOMAIN
- "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.regex=^http[s]?://([^/]*)/(.*)"
- "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.replacement=https://${DOMAIN}/$${2}"
- "traefik.http.middlewares.${STACK_NAME}-redirecthostname.redirectregex.permanent=true"
# Redirect HTTP to HTTPS
- "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.scheme=https"
- "traefik.http.middlewares.${STACK_NAME}-redirectscheme.redirectscheme.permanent=true"
environment:
STACK_NAME: $STACK_NAME
volumes:
- static:/static:ro
- data:/data:ro
configs:
- source: nginx
target: /etc/nginx/nginx.conf
mode: 0600
- source: nginx_umap
target: /etc/nginx/snippets/umap.conf
mode: 0600
networks:
- proxy
- umap
app:
image: umap/umap:3.5.0
hostname: ${STACK_NAME}-app
networks:
- umap
deploy:
restart_policy:
condition: on-failure
labels:
## When you're ready for release, run "abra recipe sync <name>" to set this
- "coop-cloud.${STACK_NAME}.version=0.1.0+3.5.0"
## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore
# - "backupbot.backup=true"
# - "backupbot.backup.path=/some/path"
environment:
DATABASE_URL: postgis://postgres@db/postgres
STATIC_ROOT: /srv/umap/static
MEDIA_ROOT: /srv/umap/uploads
REALTIME_ENABLED: "True"
REDIS_URL: redis://redis:6379
volumes:
- data:/srv/umap/uploads
- static:/srv/umap/static
configs:
- source: config
target: /etc/umap/umap.conf
mode: 0600
secrets:
- secret_key
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:8000"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
db:
image: postgis/postgis:14-3.4-alpine
networks:
- umap
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- db:/var/lib/postgresql/data
redis:
image: redis:8.4.0
command: ["redis-server"]
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
networks:
- umap
volumes:
data:
static:
db:
secrets:
secret_key:
external: true
name: ${STACK_NAME}_secret_key_${SECRET_SECRET_KEY_VERSION}
configs:
config:
name: ${STACK_NAME}_config_${CONFIG_VERSION}
file: ./umap.conf.tmpl
template_driver: golang
nginx:
name: ${STACK_NAME}_nginx_${NGINX_VERSION}
file: ./nginx.conf.tmpl
template_driver: golang
nginx_umap:
name: ${STACK_NAME}_nginx_umap_${NGINX_UMAP_VERSION}
file: ./nginx-umap.conf
template_driver: golang
networks:
umap:
proxy:
external: true