From e7594cd6a3f398fcc51279a8e6574c285f4b3514 Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Wed, 21 Aug 2024 13:29:56 +0200 Subject: [PATCH] docker: add resalloc-webui container Available at http://127.0.0.1:5005/ When running the `resalloc-webui` container for the first time, it will probably be necessary to manually rebuild the `resalloc` container first, to create the database on a shared volume. docker-compose up -d --build resalloc --- docker-compose.yaml | 19 ++++++++++++++++++- docker/resalloc/Dockerfile | 6 ++++-- .../files/etc/resallocserver/server.yaml | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f7a789f51..34cb540db 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,6 +8,7 @@ # 5001:5001 -- DistGit Apache # 5002:5002 -- Backend Nginx # --:5003 -- Keygen Apache (obtaining keys) +# 5005:5000 -- Resalloc WebUI # # Other ports: # 5009:5432 -- PostgreSQL database @@ -62,9 +63,24 @@ services: hostname: resalloc depends_on: - database - command: /usr/bin/resalloc-server stdin_open: true tty: true + volumes: + - resalloc:/persistent + + resalloc-webui: + build: + context: docker/resalloc + hostname: resalloc-webui + depends_on: + - resalloc + command: python3 -c "from resallocwebui.app import app; app.run(host='0.0.0.0')" + stdin_open: true + tty: true + ports: + - "5005:5000" + volumes: + - resalloc:/persistent redis: image: centos/redis-32-centos7 @@ -172,3 +188,4 @@ volumes: dist-git: database: redis: + resalloc: diff --git a/docker/resalloc/Dockerfile b/docker/resalloc/Dockerfile index af96db1a0..d3657504b 100644 --- a/docker/resalloc/Dockerfile +++ b/docker/resalloc/Dockerfile @@ -12,6 +12,7 @@ RUN dnf install -y ansible \ resalloc \ resalloc-aws \ resalloc-server \ + resalloc-webui \ sqlite \ findutils \ openssh-clients \ @@ -20,5 +21,6 @@ RUN dnf install -y ansible \ # copy filesystem setup COPY files/ / -RUN cd $(rpm -ql resalloc-server |grep alembic.ini |xargs dirname) \ - && alembic-3 upgrade head +CMD cd $(rpm -ql resalloc-server |grep alembic.ini |xargs dirname) \ + && alembic-3 upgrade head \ + && /usr/bin/resalloc-server diff --git a/docker/resalloc/files/etc/resallocserver/server.yaml b/docker/resalloc/files/etc/resallocserver/server.yaml index 5cf41b32b..0a81f9df4 100644 --- a/docker/resalloc/files/etc/resallocserver/server.yaml +++ b/docker/resalloc/files/etc/resallocserver/server.yaml @@ -7,7 +7,7 @@ #db_url: 'postgresql://resalloc@/resalloc' #For PostgreSQL listening on host/port, using password. #db_url: 'postgresql://resalloc:pass@localhost:5432/resalloc' -db_url: 'sqlite:////var/lib/resallocserver/db.sqlite' +db_url: 'sqlite:////persistent/db.sqlite' logdir: '/var/log/resallocserver'