diff --git a/docker-compose.yml b/docker-compose.yml index c4a5f21..6954a22 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,4 +6,8 @@ services: api: build: . ports: - - 1379:1379 \ No newline at end of file + - 1379:1379 + web: + build: nginx + ports: + - 80:80 \ No newline at end of file diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..6a95a6f --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:latest AS base + +COPY ./nginx.conf /etc/nginx/conf.d/default.conf \ No newline at end of file diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..e0d4cb9 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 80; + server_name steve; + + location / { + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_pass http://ui:3000; + } + + location /api/ { + rewrite ^/api(/.*)$ $1 break; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_pass http://api:1379; + } +} \ No newline at end of file