Skip to content

🎉 Add openproject #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions openproject/.env.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DOMAIN="example.com"

TAG=13
OPENPROJECT_HTTPS=true
OPENPROJECT_HSTS=true
OPENPROJECT_RAILS__RELATIVE__URL__ROOT=
RAILS_MIN_THREADS=4
RAILS_MAX_THREADS=16
IMAP_ENABLED=false
POSTGRES_PASSWORD=p4ssw0rd

3 changes: 3 additions & 0 deletions openproject/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.env
/data
/data/*
34 changes: 34 additions & 0 deletions openproject/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Openproject

# Requirements
- Docker
- Docker-compose
- traefik as a reverse proxy in front of it

# Setup
## `.env` file
Change the domain in the `.env` file to your domain and the password of the database.
```yaml
DOMAIN="example.com"

TAG=13
OPENPROJECT_HTTPS=true
OPENPROJECT_HSTS=true
OPENPROJECT_RAILS__RELATIVE__URL__ROOT=
RAILS_MIN_THREADS=4
RAILS_MAX_THREADS=16
IMAP_ENABLED=false
POSTGRES_PASSWORD=p4ssw0rd
```
```sh
$ cd openproject
$ docker-compose up -d
```
or
```sh
./docker.sh -S proxy -r
./docker.sh -S openproject -r
```

## Login
It will take some time until the server is up and running. Open https://openproject.example.com and login with user `admin` and password `admin`
133 changes: 133 additions & 0 deletions openproject/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
version: "3.7"

x-op-restart-policy: &restart_policy
restart: unless-stopped
x-op-image: &image
image: openproject/community:${TAG:-13}
x-op-app: &app
<<: [*image, *restart_policy]
environment:
OPENPROJECT_HTTPS: "true"
OPENPROJECT_HOST__NAME: "openproject.${DOMAIN}"
OPENPROJECT_HSTS: "${OPENPROJECT_HSTS:-true}"
RAILS_CACHE_STORE: "memcache"
OPENPROJECT_CACHE__MEMCACHE__SERVER: "openproject-cache:11211"
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
DATABASE_URL: "postgres://postgres:${POSTGRES_PASSWORD:-p4ssw0rd}@db/openproject?pool=20&encoding=unicode&reconnect=true"
RAILS_MIN_THREADS: ${RAILS_MIN_THREADS:-4}
RAILS_MAX_THREADS: ${RAILS_MAX_THREADS:-16}
# set to true to enable the email receiving feature. See ./docker/cron for more options
IMAP_ENABLED: "${IMAP_ENABLED:-false}"
volumes:
- "./data/opdata:/var/openproject/assets"

services:
openproject-db:
container_name: openproject-db
hostname: db
image: postgres:13
<<: *restart_policy
stop_grace_period: "3s"
volumes:
- "./data/pgdata:/var/lib/postgresql/data"
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-p4ssw0rd}
POSTGRES_DB: openproject
networks:
- backend

openproject-cache:
container_name: openproject-cache
image: memcached
<<: *restart_policy
networks:
- backend

openproject-proxy:
container_name: openproject-proxy
<<: [*image, *restart_policy]
command: "./docker/prod/proxy"
# ports:
# - "${PORT:-443}:80"
environment:
APP_HOST: openproject-web
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
depends_on:
- openproject-web
networks:
- frontend
- proxy
labels:
- "traefik.enable=true" #<== Enable traefik
- "traefik.http.routers.openproject-secured.rule=Host(`openproject.${DOMAIN}`)" #<== Set domain
- "traefik.http.routers.openproject-secured.entrypoints=websecure" #<== Set entry point for HTTPS
- "traefik.http.routers.openproject-secured.tls.certresolver=mytlschallenge" #<== Set certsresolvers for https
- "traefik.http.routers.openproject-secured.middlewares=authelia" #<== Add Authelia middlewares to protect login
- "traefik.http.routers.openproject-secured.service=openproject-service" #<== Set service
- "traefik.http.services.openproject-service.loadbalancer.server.port=80" #<== Set target port on container

openproject-web:
container_name: openproject-web
<<: *app
command: "./docker/prod/web"
networks:
- frontend
- backend
depends_on:
- openproject-db
- openproject-cache
- openproject-seeder
labels:
- autoheal=true
healthcheck:
test: ["CMD", "curl", "-f", "https://openproject.${DOMAIN}${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}/health_checks/default"]
interval: 10s
timeout: 3s
retries: 3
start_period: 30s

# openproject-autoheal:
# container_name: openproject-autoheal
# image: willfarrell/autoheal:1.2.0
# volumes:
# - "/var/run/docker.sock:/var/run/docker.sock"
# environment:
# AUTOHEAL_CONTAINER_LABEL: autoheal
# AUTOHEAL_START_PERIOD: 600
# AUTOHEAL_INTERVAL: 30

openproject-worker:
container_name: openproject-worker
<<: *app
command: "./docker/prod/worker"
networks:
- backend
depends_on:
- openproject-db
- openproject-cache
- openproject-seeder

openproject-cron:
container_name: openproject-cron
<<: *app
command: "./docker/prod/cron"
networks:
- backend
depends_on:
- openproject-db
- openproject-cache
- openproject-seeder

openproject-seeder:
container_name: openproject-seeder
<<: *app
command: "./docker/prod/seeder"
restart: on-failure
networks:
- backend

networks:
frontend:
backend:
proxy:
external: true