mirror of
https://github.com/sergeyyarkov/next-apollo-graphql-setup.git
synced 2026-10-11 18:29:36 +03:00
🌐 added nginx
This commit is contained in:
parent
982e332214
commit
ece8e35f87
@ -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'
|
||||
@ -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
5
nginx/Dockerfile
Normal 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
24
nginx/default.conf
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user