mirror of
https://github.com/opf/openproject-deploy.git
synced 2026-02-14 08:49:51 +00:00
* [#53464] replaced containered proxy with caddy - running compose stack work with slim container now - using caddy as a light weight proxy - tested with and without OPENPROJECT_RAILS__RELATIVE__URL__ROOT * rename doc root to avoid confusion, use slim as default container --------- Co-authored-by: Markus Kahl <machisuji@gmail.com>
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,5 @@
|
||||
# Jetbrains IDE
|
||||
.idea/
|
||||
|
||||
*.swp
|
||||
*.tar.gz
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# Please refer to our documentation to see all possible variables:
|
||||
# https://www.openproject.org/docs/installation-and-operations/configuration/environment/
|
||||
#
|
||||
TAG=14
|
||||
TAG=14-slim
|
||||
OPENPROJECT_HTTPS=false
|
||||
OPENPROJECT_HOST__NAME=localhost
|
||||
PORT=127.0.0.1:8080
|
||||
|
||||
9
compose/Caddyfile.template
Normal file
9
compose/Caddyfile.template
Normal file
@@ -0,0 +1,9 @@
|
||||
:80 {
|
||||
root * /public
|
||||
|
||||
reverse_proxy * http://${APP_HOST}:8080
|
||||
|
||||
file_server
|
||||
|
||||
log
|
||||
}
|
||||
@@ -5,11 +5,12 @@ networks:
|
||||
volumes:
|
||||
pgdata:
|
||||
opdata:
|
||||
assets:
|
||||
|
||||
x-op-restart-policy: &restart_policy
|
||||
restart: unless-stopped
|
||||
x-op-image: &image
|
||||
image: openproject/openproject:${TAG:-14}
|
||||
image: openproject/openproject:${TAG:-14-slim}
|
||||
x-op-app: &app
|
||||
<<: [*image, *restart_policy]
|
||||
environment:
|
||||
@@ -47,17 +48,21 @@ services:
|
||||
- backend
|
||||
|
||||
proxy:
|
||||
<<: [*image, *restart_policy]
|
||||
command: "./docker/prod/proxy"
|
||||
image: caddy:2
|
||||
<<: *restart_policy
|
||||
command: "/usr/local/bin/proxy-entrypoint.sh"
|
||||
ports:
|
||||
- "${PORT:-8080}:80"
|
||||
environment:
|
||||
APP_HOST: web
|
||||
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
|
||||
depends_on:
|
||||
- web
|
||||
networks:
|
||||
- frontend
|
||||
volumes:
|
||||
- ./Caddyfile.template:/etc/caddy/Caddyfile.template:ro
|
||||
- ./proxy-entrypoint.sh:/usr/local/bin/proxy-entrypoint.sh:ro
|
||||
- assets:/public:ro
|
||||
|
||||
web:
|
||||
<<: *app
|
||||
@@ -77,6 +82,8 @@ services:
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
volumes:
|
||||
- assets:/app/public
|
||||
|
||||
autoheal:
|
||||
image: willfarrell/autoheal:1.2.0
|
||||
|
||||
7
compose/proxy-entrypoint.sh
Executable file
7
compose/proxy-entrypoint.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
sed 's|${APP_HOST}|'"$APP_HOST"'|g' /etc/caddy/Caddyfile.template > /etc/caddy/Caddyfile
|
||||
|
||||
caddy run --config /etc/caddy/Caddyfile
|
||||
Reference in New Issue
Block a user