-
Notifications
You must be signed in to change notification settings - Fork 0
Staging #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Staging #74
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2682fee
feat: add nginx reverse proxy and fix docker build env args
Shashank0701-byte c9e1445
Merge pull request #73 from Shashank0701-byte/feature/docker-nginx-proxy
Shashank0701-byte e7dcec2
fix: api endpoints due to the pre built docker image
Shashank0701-byte 941ee4b
Merge pull request #75 from Shashank0701-byte/feature/docker-nginx-proxy
Shashank0701-byte 33d53d4
fix(docker-compose): update healthcheck to use BusyBox-compatible wge…
Shashank0701-byte 1f6f9b8
Merge pull request #76 from Shashank0701-byte/feature/docker-nginx-proxy
Shashank0701-byte 439d5e6
fix: Nextjs environment variables in the
Shashank0701-byte 57ceb8a
Merge pull request #77 from Shashank0701-byte/feature/docker-nginx-proxy
Shashank0701-byte 6123802
fix: necessary refinements to our Docker and Nginx configurations
Shashank0701-byte 9e7988a
Merge pull request #78 from Shashank0701-byte/feature/docker-nginx-proxy
Shashank0701-byte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,5 @@ | ||
| import { NextResponse } from 'next/server'; | ||
|
|
||
| export async function GET() { | ||
| return NextResponse.json({ status: 'ok' }, { status: 200 }); | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,13 +1,48 @@ | ||
| version: '3.8' | ||
| services: | ||
| web: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "3000:3000" | ||
| args: | ||
| - NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY:?NEXT_PUBLIC_FIREBASE_API_KEY is required} | ||
| - NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN:?NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN is required} | ||
| - NEXT_PUBLIC_FIREBASE_PROJECT_ID=${NEXT_PUBLIC_FIREBASE_PROJECT_ID:?NEXT_PUBLIC_FIREBASE_PROJECT_ID is required} | ||
| - NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET:?NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET is required} | ||
| - NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID:?NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID is required} | ||
| - NEXT_PUBLIC_FIREBASE_APP_ID=${NEXT_PUBLIC_FIREBASE_APP_ID:?NEXT_PUBLIC_FIREBASE_APP_ID is required} | ||
| expose: | ||
| # Expose port 3000 internally to Nginx, but block it from the host machine | ||
| - "3000" | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| - NODE_ENV=production | ||
| restart: unless-stopped | ||
| restart: unless-stopped | ||
| networks: | ||
| - systemcraft_net | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "wget --spider --tries=1 http://127.0.0.1:3000/api/health || exit 1"] | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 3 | ||
| start_period: 15s | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| nginx: | ||
| # Use the tiny official Nginx image | ||
| image: nginx:alpine | ||
| ports: | ||
| # Open port 80 to your computer/the internet | ||
| - "80:80" | ||
| volumes: | ||
| # Mount the configuration file you just wrote directly into the Nginx container | ||
| - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro | ||
| depends_on: | ||
| web: | ||
| condition: service_healthy | ||
| restart: unless-stopped | ||
| networks: | ||
| - systemcraft_net | ||
|
|
||
| # Create an isolated internal network for them to talk securely | ||
| networks: | ||
| systemcraft_net: | ||
This file contains hidden or 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,25 @@ | ||
| map $http_upgrade $connection_upgrade { | ||
| default upgrade; | ||
| '' close; | ||
| } | ||
|
|
||
| server { | ||
| listen 80; | ||
| server_name localhost; | ||
|
|
||
| # Enable runtime DNS re-resolution (use Docker's internal DNS resolver) | ||
| resolver 127.0.0.11 valid=30s; | ||
| set $upstream_endpoint http://web:3000; | ||
|
|
||
| location / { | ||
| proxy_pass $upstream_endpoint; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection $connection_upgrade; | ||
| proxy_set_header Host $host; | ||
| proxy_cache_bypass $http_upgrade; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.