Browse Source

add nginx

main
matthew 2 years ago
parent
commit
dbbd9f4d1f
  1. 9
      docker-compose.yml
  2. 2
      nginx/Dockerfile
  3. 11
      nginx/default.conf

9
docker-compose.yml

@ -24,9 +24,6 @@ services:
container_name: front container_name: front
build: ./searching-front build: ./searching-front
restart: always restart: always
ports:
- 80:3000
- 8080:8080
watcher: watcher:
container_name: watcher container_name: watcher
depends_on: depends_on:
@ -35,8 +32,12 @@ services:
context: ./searching-front context: ./searching-front
dockerfile: Dockerfile.watcher dockerfile: Dockerfile.watcher
restart: always restart: always
nginx:
restart: always
build:
context: ./nginx
ports: ports:
- 8888:8080 - "80:80"
networks: networks:
es-net: es-net:

2
nginx/Dockerfile

@ -0,0 +1,2 @@
FROM nginx
COPY default.conf /etc/nginx/conf.d/default.conf

11
nginx/default.conf

@ -0,0 +1,11 @@
server {
location / {
proxy_set_header Host $host;
proxy_set_header HelloMatthew True;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://front:3000;
}
}
Loading…
Cancel
Save