Huan He commited on
Commit
a5ad565
1 Parent(s): 9b869db

change to nginx for serving

Browse files
50x.html ADDED
@@ -0,0 +1 @@
 
 
1
+ System Error
conf/dev/Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
- # serve the data with busybox
2
- FROM busybox:1.36.1
3
- RUN adduser -D static
4
- USER static
5
- WORKDIR /home/static
 
 
6
  COPY ./index.html ./
 
 
1
+ # serve the data with nginx
2
+ FROM nginx:alpine
3
+
4
+ # set the working folder in the container
5
+ WORKDIR /usr/share/nginx/html
6
+
7
+ # copy the nginx configuration
8
  COPY ./index.html ./
9
+ COPY ./50x.html ./
conf/dev/default.conf ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 80;
3
+ listen [::]:80;
4
+ server_name localhost;
5
+
6
+ location / {
7
+ root /usr/share/nginx/html;
8
+ index index.html index.htm;
9
+
10
+ # Enable CORS for specific origin and allow credentials
11
+ add_header 'Access-Control-Allow-Origin' 'http://localhost:5273' always;
12
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
13
+ add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
14
+ add_header 'Access-Control-Allow-Credentials' 'true' always;
15
+
16
+ # Handle preflight requests
17
+ if ($request_method = OPTIONS) {
18
+ add_header 'Access-Control-Allow-Origin' 'http://localhost:5273';
19
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
20
+ add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
21
+ add_header 'Access-Control-Allow-Credentials' 'true';
22
+ return 204;
23
+ }
24
+ }
25
+
26
+ # redirect server error pages to the static page /50x.html
27
+ #
28
+ error_page 500 502 503 504 /50x.html;
29
+ location = /50x.html {
30
+ root /usr/share/nginx/html;
31
+ }
32
+ }
33
+
conf/dev/docker-compose.yml CHANGED
@@ -6,14 +6,14 @@ services:
6
  context: ../../
7
  dockerfile: ./conf/dev/Dockerfile
8
  container_name: bike-ds
9
- working_dir: /home/static
10
- command: busybox httpd -f -v -p 28256
11
  environment:
12
  NODE_ENV: dev
13
  volumes:
14
- - ../../data:/home/static/dataset
 
15
  ports:
16
- - 28256:28256
17
  restart: always
18
  networks:
19
  - bikenet
 
6
  context: ../../
7
  dockerfile: ./conf/dev/Dockerfile
8
  container_name: bike-ds
9
+ working_dir: /usr/share/nginx/html
 
10
  environment:
11
  NODE_ENV: dev
12
  volumes:
13
+ - ./default.conf:/etc/nginx/conf.d/default.conf
14
+ - ../../data:/usr/share/nginx/html/dataset
15
  ports:
16
+ - 28256:80
17
  restart: always
18
  networks:
19
  - bikenet
conf/medviz/Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
- # serve the data with busybox
2
- FROM busybox:1.36.1
3
- RUN adduser -D static
4
- USER static
5
- WORKDIR /home/static
6
- COPY ./index.html ./
 
 
 
 
1
+ # serve the data with nginx
2
+ FROM nginx:alpine
3
+
4
+ # set the working folder in the container
5
+ WORKDIR /usr/share/nginx/html
6
+
7
+ # copy the nginx configuration
8
+ COPY ./index.html ./
9
+ COPY ./50x.html ./
conf/medviz/default.conf ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 80;
3
+ listen [::]:80;
4
+ server_name localhost;
5
+
6
+ location / {
7
+ root /usr/share/nginx/html;
8
+ index index.html index.htm;
9
+
10
+ # Enable CORS for specific origin and allow credentials
11
+ add_header 'Access-Control-Allow-Origin' 'https://medviz.org' always;
12
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
13
+ add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
14
+ add_header 'Access-Control-Allow-Credentials' 'true' always;
15
+
16
+ # Handle preflight requests
17
+ if ($request_method = OPTIONS) {
18
+ add_header 'Access-Control-Allow-Origin' 'https://medviz.org';
19
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
20
+ add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
21
+ add_header 'Access-Control-Allow-Credentials' 'true';
22
+ return 204;
23
+ }
24
+ }
25
+
26
+ # redirect server error pages to the static page /50x.html
27
+ #
28
+ error_page 500 502 503 504 /50x.html;
29
+ location = /50x.html {
30
+ root /usr/share/nginx/html;
31
+ }
32
+ }
33
+
conf/medviz/docker-compose.yml CHANGED
@@ -6,14 +6,14 @@ services:
6
  context: ../../
7
  dockerfile: ./conf/medviz/Dockerfile
8
  container_name: bike-ds
9
- working_dir: /home/static
10
- command: busybox httpd -f -v -p 28256
11
  environment:
12
  NODE_ENV: medviz
13
  volumes:
14
- - ../../data:/home/static/dataset
 
15
  ports:
16
- - 28256:28256
17
  restart: always
18
  networks:
19
  - bikenet
 
6
  context: ../../
7
  dockerfile: ./conf/medviz/Dockerfile
8
  container_name: bike-ds
9
+ working_dir: /usr/share/nginx/html
 
10
  environment:
11
  NODE_ENV: medviz
12
  volumes:
13
+ - ./default.conf:/etc/nginx/conf.d/default.conf
14
+ - ../../data:/usr/share/nginx/html/dataset
15
  ports:
16
+ - 28256:80
17
  restart: always
18
  networks:
19
  - bikenet
conf/spinup/Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
- # serve the data with busybox
2
- FROM busybox:1.36.1
3
- RUN adduser -D static
4
- USER static
5
- WORKDIR /home/static
 
 
6
  COPY ./index.html ./
 
 
1
+ # serve the data with nginx
2
+ FROM nginx:alpine
3
+
4
+ # set the working folder in the container
5
+ WORKDIR /usr/share/nginx/html
6
+
7
+ # copy the nginx configuration
8
  COPY ./index.html ./
9
+ COPY ./50x.html ./
conf/spinup/default.conf ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ server {
2
+ listen 80;
3
+ listen [::]:80;
4
+ server_name localhost;
5
+
6
+ location / {
7
+ root /usr/share/nginx/html;
8
+ index index.html index.htm;
9
+
10
+ # Enable CORS for specific origin and allow credentials
11
+ add_header 'Access-Control-Allow-Origin' 'https://spinup-0028ce.spinup.yale.edu' always;
12
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
13
+ add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
14
+ add_header 'Access-Control-Allow-Credentials' 'true' always;
15
+
16
+ # Handle preflight requests
17
+ if ($request_method = OPTIONS) {
18
+ add_header 'Access-Control-Allow-Origin' 'https://spinup-0028ce.spinup.yale.edu';
19
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
20
+ add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization';
21
+ add_header 'Access-Control-Allow-Credentials' 'true';
22
+ return 204;
23
+ }
24
+ }
25
+
26
+ # redirect server error pages to the static page /50x.html
27
+ #
28
+ error_page 500 502 503 504 /50x.html;
29
+ location = /50x.html {
30
+ root /usr/share/nginx/html;
31
+ }
32
+ }
33
+
conf/spinup/docker-compose.yml CHANGED
@@ -6,14 +6,14 @@ services:
6
  context: ../../
7
  dockerfile: ./conf/spinup/Dockerfile
8
  container_name: bike-ds
9
- working_dir: /home/static
10
- command: busybox httpd -f -v -p 28256
11
  environment:
12
  NODE_ENV: spinup
13
  volumes:
14
- - ../../data:/home/static/dataset
 
15
  ports:
16
- - 28256:28256
17
  restart: always
18
  networks:
19
  - bikenet
 
6
  context: ../../
7
  dockerfile: ./conf/spinup/Dockerfile
8
  container_name: bike-ds
9
+ working_dir: /usr/share/nginx/html
 
10
  environment:
11
  NODE_ENV: spinup
12
  volumes:
13
+ - ./default.conf:/etc/nginx/conf.d/default.conf
14
+ - ../../data:/usr/share/nginx/html/dataset
15
  ports:
16
+ - 28256:80
17
  restart: always
18
  networks:
19
  - bikenet
data/medviz/HCP-438k.json CHANGED
@@ -9,8 +9,8 @@
9
  "description": "Publications with high citations indexed by PubMed",
10
 
11
  "final_dataset": {
12
- "points_tsv": "/dataset/HCP-438k.tsv",
13
- "topics_json": "/dataset/PD1-46k.topics.json"
14
  },
15
 
16
  "config": {
 
9
  "description": "Publications with high citations indexed by PubMed",
10
 
11
  "final_dataset": {
12
+ "points_tsv": "/dataset/medviz/HCP-438k.tsv",
13
+ "topics_json": "/dataset/medviz/PD1-46k.topics.json"
14
  },
15
 
16
  "config": {
data/medviz/NS-290k.json CHANGED
@@ -9,7 +9,7 @@
9
  "description": "Publications from Nature and Science in the past 100 years",
10
 
11
  "final_dataset": {
12
- "points_tsv": "/dataset/NS-290k.tsv",
13
  "topics_json": ""
14
  },
15
 
 
9
  "description": "Publications from Nature and Science in the past 100 years",
10
 
11
  "final_dataset": {
12
+ "points_tsv": "/dataset/medviz/NS-290k.tsv",
13
  "topics_json": ""
14
  },
15
 
data/medviz/PD1-46k.json CHANGED
@@ -9,8 +9,8 @@
9
  "description": "This dataset contains the data of PD-1 and PD-L1 studies.",
10
 
11
  "final_dataset": {
12
- "points_tsv": "/dataset/PD1-46k.tsv",
13
- "topics_json": "/dataset/PD1-46k.topics.json"
14
  },
15
 
16
  "config": {
 
9
  "description": "This dataset contains the data of PD-1 and PD-L1 studies.",
10
 
11
  "final_dataset": {
12
+ "points_tsv": "/dataset/medviz/PD1-46k.tsv",
13
+ "topics_json": "/dataset/medviz/PD1-46k.topics.json"
14
  },
15
 
16
  "config": {