-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from PlasmicZ/Plasmicz/Proxy
proxied the frontend through nginx
- Loading branch information
Showing
9 changed files
with
103 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Stage 1: Build frontend | ||
FROM node:alpine AS frontend | ||
|
||
WORKDIR /usr/app | ||
|
||
RUN npm install --global pm2 | ||
|
||
COPY frontend/package*.json ./ | ||
|
||
RUN npm install --production --force | ||
|
||
COPY frontend/ ./ | ||
|
||
RUN npm run build | ||
|
||
EXPOSE 3000 | ||
|
||
USER node | ||
|
||
CMD [ "pm2-runtime", "npm", "--", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
worker_processes auto; # auto-detect number of logical CPU cores | ||
|
||
events { | ||
worker_connections 512; # set the max number of simultaneous connections (per worker process) | ||
} | ||
http { | ||
server { | ||
listen 80 default_server; | ||
server_name localhost; | ||
server_tokens off; | ||
|
||
gzip on; | ||
gzip_proxied any; | ||
gzip_comp_level 4; | ||
gzip_types text/css application/javascript image/svg+xml; | ||
|
||
location / { | ||
proxy_pass http://frontend: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; | ||
} | ||
|
||
location /api { | ||
rewrite ^/api/(.*)$ /$1 break; | ||
proxy_pass http://backend:8000; | ||
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; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters