🌐 added nginx

This commit is contained in:
Sergey Yarkov 2020-03-06 00:13:22 +03:00
parent 982e332214
commit ece8e35f87
4 changed files with 37 additions and 2 deletions

View File

@ -5,4 +5,10 @@ services:
restart: always
build: .
ports:
- '3000:3000'
- '3000:80'
webserver:
container_name: webserver
restart: unless-stopped
build: nginx
ports:
- '80:80'

View File

@ -11,6 +11,6 @@ module.exports = withSass({
return config
},
env: {
GRAPHQL_API_URI: 'http://localhost:3000/api/graphql'
GRAPHQL_API_URI: 'http://localhost/api/graphql'
}
})

5
nginx/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY default.conf /etc/nginx/conf.d/

24
nginx/default.conf Normal file
View File

@ -0,0 +1,24 @@
server {
listen 80;
server_name localhost;
# location / {
# proxy_pass http://apollo-next-graphql:3000;
# }
location / {
proxy_pass http://apollo-next-graphql:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}