Skip to content

Commit

Permalink
updated dockerfile (using node-alpine)
Browse files Browse the repository at this point in the history
  • Loading branch information
LakhindarPal committed Jun 14, 2024
1 parent 49a66c0 commit 2c9cbac
Show file tree
Hide file tree
Showing 6 changed files with 3,208 additions and 12 deletions.
47 changes: 47 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Node modules directory
node_modules

# bun lockfile
bun.lockb

# Logs
logs
*.log
npm-debug.log*

# Directory for environments
.env
.env.sample

# Docker-related files
Dockerfile
.dockerignore

# Documentation and metadata files
README.md
COMMANDS.md
CONTRIBUTING.md
LICENSE
SECURITY.md

# Configuration files
.editorconfig
.prettierignore
.prettierrc
eslint.config.js

# Git-related files
.git
.gitignore
.gitattributes

# IDE/editor directories and files
.vscode
.idea

# OS-specific files
.DS_Store
Thumbs.db

# GitHub-related directory
.github
10 changes: 5 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Discord Bot Token
DISCORD_TOKEN="xyz-your-super-secret-bot-token-here-abc-123"
DISCORD_TOKEN=xyz-your-super-secret-bot-token-here-abc-123

# Client Id
CLIENT_ID="123456789012345678"
CLIENT_ID=123456789012345678

# Development Guild Id
DEV_GUILD="123456789012345678"
DEV_GUILD=123456789012345678

# Developer IDs (comma-separated)
DEV_IDS="12345678901234567,98765432101234567"
DEV_IDS=12345678901234567,98765432101234567

# Support Server Invite Link
SUPPORT_SERVER="https://discord.gg/invite/abc123"
SUPPORT_SERVER=https://discord.gg/invite/abc123

# Development Mode (true/false)
DEVELOPMENT_MODE=false
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# Use the official Node.js image as the base image
FROM node:20
FROM node:20-alpine

# Set the working directory inside the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install the dependencies
RUN npm install
# Install dependencies with verbose output
RUN npm ci --verbose

# Copy the rest of the application code to the working directory
COPY . .

# Install FFmpeg
RUN apt-get update && apt-get install -y ffmpeg
# Install FFmpeg using apk (for Alpine Linux)
RUN apk update && apk add --no-cache ffmpeg

# Cleanup unnecessary cache to minimize image size
RUN rm -rf /var/cache/apk/* /tmp/*

# Command to run the application
CMD ["npm", "start"]
CMD ["npm", "start"]
Binary file modified bun.lockb
Binary file not shown.
Loading

0 comments on commit 2c9cbac

Please sign in to comment.