Commit eb18b903 authored by hengwen's avatar hengwen

Use nginx to serve visualization static files

parent 6de00c9b
......@@ -6,8 +6,6 @@ services:
image: zookeeper:3.4
restart: always
hostname: zoo1
ports:
- 2181:2181
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888
......@@ -38,9 +36,9 @@ services:
restart: always
environment:
ZOO_SERVERS: zoo1:2181
# uncomment below to enable multi-sector trajectory re-planning
# SIM_SERVER: server
# SIM_PORT: 8090
# enable multi-sector trajectory re-planning
SIM_SERVER: server
SIM_PORT: 8090
server:
image: restful-server:latest
......@@ -48,7 +46,6 @@ services:
- zoo1
ports:
- 8787:8787
- 8090:8090
restart: always
environment:
ZOO_SERVERS: zoo1:2181
......@@ -58,4 +55,17 @@ services:
- java
- -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787
- -jar
- restful-2.0.0.jar
# make sure the version nr. is right
- restful-2.2.0.jar
nginx:
image: nginx:1.17
ports:
- 8090:8090
restart: always
depends_on:
- server
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
# replace the path blow to adapt to your path to visualization files
- /Users/ham/Projects/MontiSim/visualization/src/main/webapp:/app
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
client_max_body_size 50m;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
# montisim-server-restful backend
server {
listen 8090;
server_name 127.0.0.1;
root /app;
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods '*' always;
location / {
proxy_pass http://server:8090;
}
}
# include servers/*;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment