Skip to content

Commit 536b5d0

Browse files
committed
Host under /survey/
1 parent 2b30d39 commit 536b5d0

File tree

6 files changed

+42
-14
lines changed

6 files changed

+42
-14
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@ Should the port already be used please change the `dash_port` variable to a new
2020
For hosting we package interactive_RSE_comp_plot.py into a Docker image.
2121
We mount a fixed size ext4 formatted file and use it as a volume to store the submissions, to cap the maximum used disk space.
2222

23-
The mountable file, `submissions.volume`, and the mount point, `submissions`, are created by executing
23+
The mountable file, `submissions.volume`, and the mount point, `submissions`, are created and mounted by executing
2424

2525
```
2626
sh create_volume.sh
2727
```
2828

29-
which makes sure to not override an existing file.
29+
which makes sure to not override an existing file or remount an already mounted file.
3030

31-
We build the Docker image and run a container based on it by executing
31+
We build and run the docker image using Docker Compose.
32+
The file `compose.yaml` describes how to set the container up.
33+
In addition an Nginx container is started that makes sure the survey is accessible under `/survey/` instead of the root path.
34+
35+
To run the survey execute
3236

3337
```
34-
sh build_and_start.sh
38+
docker compose up -d
3539
```
3640

37-
This will also rebuild and restart if applicable.
38-
39-
As it is configured right now, the services is reachable on port 9000 on the host.
41+
The survey is then accessible on port 9000 on the host under path `/survey/`.

group_composition_plot/build_and_start.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
nginx:
3+
image: "nginx:latest"
4+
ports:
5+
- "9000:8080"
6+
volumes:
7+
- "./nginx.conf:/etc/nginx/nginx.conf:ro"
8+
survey:
9+
build: .
10+
volumes:
11+
- "./submissions:/script/submissions"

group_composition_plot/create_volume.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ else
66
mkfs.ext4 submissions.volume
77
fi
88
mkdir -p submissions
9+
if ! mountpoint submissions; then
10+
mount -o loop submissions.volume submissions
11+
fi

group_composition_plot/interactive_RSE_comp_plot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,9 @@ def save_submission(
416416

417417

418418
if __name__ == "__main__":
419-
app = Dash("RSE Overview", external_stylesheets=[dbc.themes.BOOTSTRAP])
419+
app = Dash("RSE Overview",
420+
external_stylesheets=[dbc.themes.BOOTSTRAP],
421+
url_base_pathname='/survey/')
420422
app.layout = html.Div(
421423
[
422424
dbc.Row(create_submission_header()),

group_composition_plot/nginx.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
events {
2+
}
3+
4+
http {
5+
include mime.types;
6+
default_type application/octet-stream;
7+
8+
server {
9+
listen 8080;
10+
server_name alpha.zedif.uni-jena.de;
11+
12+
location /survey/ {
13+
proxy_pass http://survey:8014;
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)