# Sample docker-compose file to run Kanboard with Postgres
# More information at https://docs.kanboard.org/v1/admin/docker/
name: kanboard
services:
  app:
    image: ${KANBOARD_IMAGE:-kanboard/kanboard:latest}
    container_name: kanboard
    restart: always
    ports:
     - "80:80"
     - "443:443"
    volumes:
     - data:/var/www/app/data
     - plugins:/var/www/app/plugins
     - certs:/etc/nginx/ssl
    environment:
      DATABASE_URL: postgres://kanboard:kanboard-secret@db/kanboard
    depends_on:
      db:
        condition: service_healthy
  db:
    image: postgres:latest
    restart: always
    environment:
      POSTGRES_USER: kanboard
      POSTGRES_PASSWORD: kanboard-secret
      POSTGRES_DB: kanboard
    volumes:
      - db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "kanboard"]
      start_period: 15s
      interval: 10s
      timeout: 5s
volumes:
  data:
    driver: local
  plugins:
    driver: local
  certs:
    driver: local
  db:
    driver: local
