traefik_planka/docker-compose.yml
2023-12-05 11:42:09 +01:00

66 lines
2.3 KiB
YAML

version: '3.8'
networks:
default:
name: "${PROJECT_NAME}_planka_db_net"
external: false
traefik:
name: "${TRAEFIK_NETWORK}"
external: true
services:
planka:
container_name: "${PROJECT_NAME}_planka"
image: "ghcr.io/plankanban/planka:latest"
user: "1000"
command: >
bash -c
"for i in `seq 1 30`; do
./start.sh &&
s=$$? && break || s=$$?;
echo \"Tried $$i times. Waiting 5 seconds...\";
sleep 5;
done; (exit $$s)"
restart: "unless-stopped"
volumes:
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/user-avatars:/app/public/user-avatars"
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/project-background-images:/app/public/project-background-images"
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/planka/attachments:/app/private/attachments"
networks:
- "traefik"
environment:
- "BASE_URL=https://${PROJECT_URL}"
- "TRUST_PROXY=0"
- "DATABASE_URL=postgresql://postgres@db/planka"
- "SECRET_KEY=${SECRET_KEY}"
# Can be removed after installation
- "DEFAULT_ADMIN_EMAIL=${ADMIN_EMAIL}" # Do not remove if you want to prevent this user from being edited/deleted
#- "DEFAULT_ADMIN_PASSWORD=${ADMIN_PASSWORD}"
#- "DEFAULT_ADMIN_NAME=${ADMIN_NAME}"
#- "DEFAULT_ADMIN_USERNAME=${ADMIN_USERNAME}"
depends_on:
- "db"
labels:
# Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true"
# traefik
- "traefik.enable=true"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
- "traefik.http.routers.${PROJECT_NAME}_planka.rule=Host(`${PROJECT_URL}`)"
- "traefik.http.services.${PROJECT_NAME}_planka.loadbalancer.server.port=1337"
- "traefik.http.routers.${PROJECT_NAME}_planka.entrypoints=websecure"
- "traefik.http.routers.${PROJECT_NAME}_planka.tls=true"
db:
container_name: "${PROJECT_NAME}_planka_db"
image: "postgres:alpine"
restart: "unless-stopped"
labels:
# Watchtower add to auto update
- "com.centurylinklabs.watchtower.enable=true"
# traefik
- "traefik.enable=false"
volumes:
- "${PROJECT_DATA}/${PROJECT_NAME}-planka/db:/var/lib/postgresql/data"
environment:
- "POSTGRES_DB=planka"
- "POSTGRES_HOST_AUTH_METHOD=trust"