Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

1.5 KB
Raw Blame
version: '3.7'
networks:
  frontend:
    attachable: true
  backend:
    attachable: true

volumes:
  caddy_data:
  postgres_data:
  openproject_data:

x-defaults: &defaults
  build:
    context: .
  restart: unless-stopped
  env_file:
    - .env.pullpreview
  volumes:
    - "openproject_data:/var/openproject/assets"
  environment:
    - "DATABASE_URL=postgresql://app:p4ssw0rd@db:5432/app?encoding=utf8&pool=5&timeout=5000&reconnect=true"
    - "OPENPROJECT_RAILS__CACHE__STORE=file_store"
    - "RAILS_ENV=production"
    - "SECRET_KEY_BASE=d4e74f017910ac56c6ebad01165b7e1b37f4c9c02e9716836f8670cdc8d65a231e64e4f6416b19c8"
  networks:
    - backend

services:
  proxy:
    image: caddy:2
    restart: unless-stopped
    command: "caddy reverse-proxy --from '${PULLPREVIEW_URL}' --to web:8080"
    networks:
      - frontend
      - backend
    depends_on:
      - web
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "caddy_data:/data"

  db:
    image: postgres:17
    environment:
      POSTGRES_USER: app
      POSTGRES_PASSWORD: p4ssw0rd
      POSTGRES_DB: app
    networks:
      - backend
    volumes:
      - "postgres_data:/var/lib/postgresql/data"
    expose:
      - "5432"

  web:
    <<: *defaults
    expose:
      - "8080"
    command: "./docker/prod/web"
    depends_on:
      - db
      - worker

  worker:
    <<: *defaults
    command: "./docker/prod/worker --seed --set attachment_max_size=262144,host_name=${PULLPREVIEW_PUBLIC_DNS}"
    depends_on:
      - db