-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add Docker support with multi-stage build for easy deployment #22
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 10 commits into
dev
from
copilot/fix-56e5a116-4122-4aee-a30e-027bbf52710d
Jun 21, 2025
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4a66b21
π release: v1.0.0-beta.1 - Merge pull request #21 from wgtechlabs/dev
warengonzaga 2b91b56
Initial plan for issue
Copilot 23241e1
Add Dockerfile and .dockerignore for containerized deployment
Copilot a291fa6
Update README with Docker deployment instructions
Copilot 71ab6e2
Streamline .dockerignore to focus on Node.js essentials only
Copilot 65b8834
Initial plan for issue
Copilot 4b1bdd6
Add security notice to Docker section in README.md
Copilot 147c40d
Bump version to 1.0.0-beta.2 for Docker feature addition
Copilot 76e53ec
Merge pull request #23 from wgtechlabs/copilot/fix-beefc49d-d8f9-4185β¦
warengonzaga bad476e
Refactor Docker preinstall approach to use environment variables instβ¦
Copilot 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,64 @@ | ||
# Node.js | ||
node_modules/ | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
package-lock.json | ||
|
||
# Build output | ||
dist/ | ||
|
||
# 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 | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm/ | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# Test and validation scripts | ||
*-test.js | ||
*-validation.js | ||
|
||
# Development container | ||
.devcontainer/ | ||
|
||
# Documentation | ||
README.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
SECURITY.md |
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,48 @@ | ||
# Multi-stage Dockerfile for TypeScript-based Telegram Bot | ||
|
||
# Build stage | ||
FROM node:20-alpine AS builder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package files | ||
COPY package.json yarn.lock ./ | ||
|
||
# Install all dependencies (including devDependencies for build) | ||
# Configure npm and yarn for Docker environment | ||
RUN npm config set strict-ssl false && \ | ||
npm config set registry http://registry.npmjs.org/ && \ | ||
yarn config set strict-ssl false && \ | ||
sed -i 's/"preinstall": "npx only-allow yarn",/"preinstall": "",/' package.json && \ | ||
yarn install --frozen-lockfile | ||
|
||
# Copy source code | ||
COPY src/ ./src/ | ||
COPY tsconfig.json ./ | ||
|
||
# Build TypeScript | ||
RUN yarn build | ||
|
||
# Production stage | ||
FROM node:20-alpine AS production | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package files | ||
COPY package.json yarn.lock ./ | ||
|
||
# Install only production dependencies | ||
# Configure npm and yarn for Docker environment | ||
RUN npm config set strict-ssl false && \ | ||
npm config set registry http://registry.npmjs.org/ && \ | ||
yarn config set strict-ssl false && \ | ||
sed -i 's/"preinstall": "npx only-allow yarn",/"preinstall": "",/' package.json && \ | ||
yarn install --frozen-lockfile --production | ||
|
||
# Copy built application from builder stage | ||
COPY --from=builder /app/dist ./dist | ||
|
||
# Set the entrypoint | ||
CMD ["node", "dist/index.js"] |
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
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.