-
-
Notifications
You must be signed in to change notification settings - Fork 0
Add Docker support for containerized deployment #3
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
warengonzaga
merged 3 commits into
dev
from
copilot/fix-3de98a26-31e5-4f11-b5a5-0c57e7f0b894
Jun 21, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,82 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # Build output | ||
| dist/ | ||
| build/ | ||
|
|
||
| # Git | ||
| .git/ | ||
| .gitignore | ||
|
|
||
| # Environment files | ||
| .env | ||
| .env.* | ||
| !.env.example | ||
|
|
||
| # IDE and editor files | ||
| .vscode/ | ||
| .idea/ | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # OS generated files | ||
| .DS_Store | ||
| .DS_Store? | ||
| ._* | ||
| .Spotlight-V100 | ||
| .Trashes | ||
| ehthumbs.db | ||
| Thumbs.db | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log | ||
|
|
||
| # Runtime data | ||
| pids/ | ||
| *.pid | ||
| *.seed | ||
| *.pid.lock | ||
|
|
||
| # Coverage directory | ||
| coverage/ | ||
| *.lcov | ||
|
|
||
| # Temporary folders | ||
| tmp/ | ||
| temp/ | ||
|
|
||
| # Documentation | ||
| docs/ | ||
| ai_context/ | ||
| README.md | ||
| CONTRIBUTING.md | ||
| CODE_OF_CONDUCT.md | ||
| LICENSE | ||
| SECURITY.md | ||
|
|
||
| # Package manager files | ||
| package-lock.json | ||
| .yarn-integrity | ||
| .yarn/ | ||
|
|
||
| # TypeScript | ||
| *.tsbuildinfo | ||
|
|
||
| # Cache | ||
| .cache/ | ||
| .parcel-cache/ | ||
| .eslintcache | ||
| .rpt2_cache/ | ||
| .rts2_cache_cjs/ | ||
| .rts2_cache_es/ | ||
| .rts2_cache_umd/ | ||
|
|
||
| # Testing | ||
| test/ | ||
| tests/ | ||
| __tests__/ |
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,60 @@ | ||
| # Multi-stage build for Unthread Webhook Server | ||
|
|
||
| # Build stage | ||
| FROM node:20-alpine AS builder | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy package manager files | ||
| COPY package.json yarn.lock .yarnrc ./ | ||
|
|
||
| # Install all dependencies (including devDependencies for building) | ||
| RUN yarn install --frozen-lockfile --ignore-scripts | ||
|
|
||
| # Copy source code and build configuration | ||
| COPY src/ ./src/ | ||
| COPY tsconfig.json ./ | ||
|
|
||
| # Build the TypeScript application | ||
| RUN yarn build | ||
|
|
||
| # Production stage | ||
| FROM node:20-alpine AS production | ||
|
|
||
| # Set working directory | ||
| WORKDIR /app | ||
|
|
||
| # Copy package manager files | ||
| COPY package.json yarn.lock .yarnrc ./ | ||
|
|
||
| # Set environment to production | ||
| ENV NODE_ENV=production | ||
| # Install only production dependencies | ||
| RUN yarn config set strict-ssl false && \ | ||
| yarn install --frozen-lockfile --production --ignore-scripts && \ | ||
| yarn cache clean | ||
|
|
||
| # Copy built application from builder stage | ||
| COPY --from=builder /app/dist ./dist | ||
|
|
||
| # Copy environment example (for reference) | ||
| COPY .env.example ./ | ||
|
|
||
| # Create non-root user for security | ||
| RUN addgroup -g 1001 -S nodejs && \ | ||
| adduser -S nodejs -u 1001 | ||
|
|
||
| # Change ownership of the app directory to nodejs user | ||
| RUN chown -R nodejs:nodejs /app | ||
| USER nodejs | ||
|
|
||
| # Expose the port the app runs on | ||
| EXPOSE 3000 | ||
|
|
||
| # Health check | ||
| HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ | ||
| CMD node -e "require('http').get('http://localhost:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))" | ||
|
|
||
| # Start the application | ||
| CMD ["node", "dist/app.js"] | ||
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.