-
Notifications
You must be signed in to change notification settings - Fork 68
Feat/docker setup #32
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
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| # urBackend β Environment Variables | ||
| # Copy this file to .env and fill in your values before running docker-compose. | ||
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
|
|
||
| # Server | ||
| PORT=1234 | ||
| NODE_ENV=production | ||
|
|
||
| # ββ Database & Cache ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| # When using docker-compose, these are automatically overridden to point to | ||
| # internal service names (mongo, redis). You do NOT need to change these. | ||
| MONGO_URL=mongodb://mongo:27017/urbackend | ||
| REDIS_URL=redis://redis:6379 | ||
|
|
||
| # ββ Authentication ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| JWT_SECRET=your_super_secret_jwt_key_min_32_chars | ||
| ENCRYPTION_KEY=32_character_long_string_for_byod_creds | ||
| API_KEY_SALT=your_random_api_key_salt | ||
|
|
||
| # ββ External Storage (Supabase) βββββββββββββββββββββββββββββββββββββββββββββββ | ||
| # Required for file upload/storage features. | ||
| SUPABASE_URL=https://your-project.supabase.co | ||
| SUPABASE_KEY=your-supabase-anon-key | ||
|
|
||
| # ββ Email (Resend) ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| # Required for OTP / email verification flow. | ||
| RESEND_API_KEY=re_your_resend_api_key | ||
| EMAIL_FROM=onboarding@resend.dev | ||
|
|
||
| # ββ Frontend ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| FRONTEND_URL=http://localhost:5173 |
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,7 @@ | ||
| node_modules | ||
| .env | ||
| *.log | ||
| tests/ | ||
| .git | ||
| .gitignore | ||
| npm-debug.log* |
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,18 @@ | ||
| # ββ Stage: Production βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| FROM node:20-alpine | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Install dependencies first (layer caching) | ||
| COPY package*.json ./ | ||
| RUN npm ci --omit=dev | ||
|
|
||
| # Copy source | ||
| COPY . . | ||
|
|
||
| # Expose backend port | ||
| EXPOSE 1234 | ||
|
|
||
| # Start the server | ||
| CMD ["node", "app.js"] | ||
|
yash-pouranik marked this conversation as resolved.
|
||
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,47 @@ | ||
|
|
||
| services: | ||
| # ββ MongoDB βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| mongo: | ||
| image: mongo:7 | ||
| container_name: urbackend_mongo | ||
| restart: unless-stopped | ||
| ports: | ||
| - '27017:27017' | ||
|
yash-pouranik marked this conversation as resolved.
yash-pouranik marked this conversation as resolved.
|
||
| volumes: | ||
| - mongo_data:/data/db | ||
|
|
||
| # ββ Redis βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| redis: | ||
| image: redis:latest | ||
|
yash-pouranik marked this conversation as resolved.
yash-pouranik marked this conversation as resolved.
|
||
| container_name: urbackend_redis | ||
| restart: unless-stopped | ||
| ports: | ||
| - '6379:6379' | ||
|
yash-pouranik marked this conversation as resolved.
|
||
| volumes: | ||
| - redis_data:/data | ||
|
|
||
| # ββ Backend (Node.js) βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | ||
| backend: | ||
| build: | ||
| context: ./backend | ||
| dockerfile: Dockerfile | ||
| container_name: urbackend_api | ||
| restart: unless-stopped | ||
| ports: | ||
| - '1234:1234' | ||
| depends_on: | ||
| - mongo | ||
| - redis | ||
|
yash-pouranik marked this conversation as resolved.
|
||
| env_file: | ||
| - path: .env | ||
| required: false | ||
| environment: | ||
| # Override DB URLs to use Docker service names | ||
| MONGO_URL: mongodb://mongo:27017/urbackend | ||
| REDIS_URL: redis://redis:6379 | ||
| NODE_ENV: production | ||
| PORT: 1234 | ||
|
|
||
| volumes: | ||
| mongo_data: | ||
| redis_data: | ||
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.