Skip to content

Commit

Permalink
feat: added nginx deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Jan 30, 2024
1 parent 4261d1b commit 68f3b7c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-and-deploy-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
dockerfile_directory: ./
dockerfile_name: frontend/Dockerfile
process_type: web
# - name: Build, Push and Release NGINX to Heroku. # Your custom step name
# uses: gonuit/[email protected]
# with:
# email: ${{ secrets.HEROKU_EMAIL }}
# heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
# heroku_app_name: ${{ secrets.HEROKU_FRONTEND_NAME }}
# dockerfile_directory: ./nginx
# dockerfile_name: Dockerfile
# process_type: web
- name: Build, Push and Release NGINX to Heroku. # Your custom step name
uses: gonuit/[email protected]
with:
email: ${{ secrets.HEROKU_EMAIL }}
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_NGINX_NAME }}
dockerfile_directory: ./nginx
dockerfile_name: Dockerfile
process_type: web
10 changes: 10 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM nginx:stable
ENV PORT=80

ENV BACKEND=http://127.0.0.1:3000
ENV FRONTEND=http://frontend:3000
ENV WUNDERGRAPH=http://wundergraph:3002

COPY nginx.conf /etc/nginx/conf.d/default.conf.template
CMD /bin/sh -c "envsubst '\$PORT,\$BACKEND,\$FRONTEND,\$WUNDERGRAPH' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf" && nginx -g 'daemon off;'

5 changes: 0 additions & 5 deletions nginx/Dockerfile.web

This file was deleted.

22 changes: 11 additions & 11 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ server {
listen ${PORT};
listen [::]:${PORT};
server_name localhost;
# # frontend
# location / {
# proxy_pass http://frontend:3000;
# }
# frontend
location / {
proxy_pass ${FRONTEND};
}

# api
location /backend/ {
rewrite /backend/(.*) /$1 break;
proxy_pass http://127.0.0.1:3000;
proxy_pass ${BACKEND};
proxy_set_header Host $host;
}

# # graphql API composition
# location /wundergraph/graphql {
# rewrite /wundergraph/graphql /graphql break;
# proxy_pass http://wundergraph:3002;
# proxy_set_header Host $host;
# }
# graphql API composition
location /wundergraph/graphql {
rewrite /wundergraph/graphql /graphql break;
proxy_pass ${WUNDERGRAPH};
proxy_set_header Host $host;
}
}

0 comments on commit 68f3b7c

Please sign in to comment.