From 2ee876571987c71b4a5a247d59f075b8cfe22666 Mon Sep 17 00:00:00 2001 From: Luan van Pletsen Date: Wed, 27 Dec 2023 15:03:41 +0000 Subject: [PATCH] Add nginx and docker-compose --- docker-compose.yaml | 24 ++++++++++++++++++++++++ nginx.conf | 13 +++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docker-compose.yaml create mode 100644 nginx.conf diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..a1d67ea --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,24 @@ +version: "3.7" + +services: + node-server: + image: node-server + build: + context: . + dockerfile: Dockerfile + networks: + - "default" + + ngnix-server: + image: nginx:latest + ports: + - "80:80" + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf + networks: + - "default" + depends_on: + - node-server + +networks: + default: diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..d424d12 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,13 @@ +events { worker_connections 1024;} + +http { + upstream app { + server node-server:5100; + } + server { + listen 80; + location / { + proxy_pass http://app; + } + } +} \ No newline at end of file