mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
include and configure hocuspocus in AIO docker container
This commit is contained in:
@@ -39,6 +39,9 @@ ENV OPENPROJECT_INSTALLATION__TYPE=docker
|
||||
ENV OPENPROJECT_ATTACHMENTS__STORAGE__PATH=$APP_DATA_PATH/files
|
||||
ENV OPENPROJECT_RAILS__CACHE__STORE=file_store
|
||||
ENV OPENPROJECT_ANGULAR_UGLIFY=true
|
||||
# leave the following empty to fill automatically, using the bundled hocuspocus
|
||||
ENV OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__URL=
|
||||
ENV OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET=
|
||||
|
||||
RUN useradd -d /home/$APP_USER -m $APP_USER && \
|
||||
mkdir -p $APP_PATH && chown $APP_USER:$APP_USER $APP_PATH && \
|
||||
@@ -108,6 +111,8 @@ ENV PGDATA=/var/openproject/pgdata
|
||||
COPY --from=openproject/gosu /go/bin/gosu /usr/local/bin/gosu
|
||||
RUN chmod +x /usr/local/bin/gosu && gosu nobody true
|
||||
|
||||
COPY --from=openproject/hocuspocus --chown=$APP_USER:$APP_USER /app /usr/local/hocuspocus
|
||||
|
||||
RUN ./docker/prod/setup/postinstall-onprem.sh && \
|
||||
ln -s /app/docker/prod/setup/.irbrc /root/
|
||||
|
||||
|
||||
@@ -78,6 +78,21 @@ if [ "$(id -u)" = '0' ]; then
|
||||
chown "$APP_USER:$APP_USER" "$APP_PATH"
|
||||
chown -R "$APP_USER:$APP_USER" "$APP_PATH/log" "$APP_PATH/tmp" "$APP_PATH/files" "$APP_PATH/public"
|
||||
|
||||
# start: hocuspocus / collaborative editing configuration
|
||||
HP_PROTOCOL="wss"
|
||||
if [ "$OPENPROJECT_HTTPS" = "false" ]; then
|
||||
HP_PROTOCOL="ws"
|
||||
fi
|
||||
|
||||
HP_HOST=${OPENPROJECT_HOST__NAME:="localhost"}
|
||||
export OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__URL=${OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__URL:="${HP_PROTOCOL}://${HP_HOST}/hocuspocus"}
|
||||
export OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET="${OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET}"
|
||||
|
||||
if [ -z "$OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET" ]; then
|
||||
export OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET="$(tr -dc 'A-Za-z0-9!?%=' < /dev/urandom | head -c 32)"
|
||||
fi
|
||||
# :end
|
||||
|
||||
# allow to launch any command as root by prepending it with 'root'
|
||||
if [ "$1" = "root" ]; then
|
||||
shift
|
||||
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
export SECRET="${OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET}"
|
||||
|
||||
cd /usr/local/hocuspocus
|
||||
|
||||
npm start run
|
||||
@@ -18,4 +18,9 @@
|
||||
ProxyPass http://<%= ENV.fetch("APP_HOST", "127.0.0.1") %>:8080<%= location %>/ retry=0
|
||||
ProxyPassReverse http://<%= ENV.fetch("APP_HOST", "127.0.0.1") %>:8080<%= location %>/
|
||||
</Location>
|
||||
|
||||
<Location /hocuspocus>
|
||||
ProxyPass http://<%= ENV.fetch("APP_HOST", "127.0.0.1") %>:1234/ upgrade=websocket
|
||||
ProxyPassReverse http://<%= ENV.fetch("APP_HOST", "127.0.0.1") %>:1234/
|
||||
</Location>
|
||||
</VirtualHost>
|
||||
|
||||
@@ -44,6 +44,18 @@ stdout_logfile = /dev/stdout
|
||||
stdout_logfile_maxbytes = 0
|
||||
stderr_logfile_maxbytes = 0
|
||||
|
||||
[program:hocuspocus]
|
||||
priority=6
|
||||
user=app
|
||||
environment=HOME="/home/%(ENV_APP_USER)s",USER="%(ENV_APP_USER)s"
|
||||
directory=%(ENV_APP_PATH)s
|
||||
command=./docker/prod/hocuspocus
|
||||
autorestart=true
|
||||
stderr_logfile = /dev/stderr
|
||||
stdout_logfile = /dev/stdout
|
||||
stdout_logfile_maxbytes = 0
|
||||
stderr_logfile_maxbytes = 0
|
||||
|
||||
[program:cron]
|
||||
priority=100
|
||||
user=app
|
||||
|
||||
Reference in New Issue
Block a user