dockerfile and docker-compose

This commit is contained in:
Kumaraguru 2024-12-16 18:05:49 +00:00
parent 5eb14ec7a1
commit b3177f0cf5
No known key found for this signature in database
GPG Key ID: 4E4555A84ECD28F7
4 changed files with 27 additions and 5 deletions

View File

@ -11,8 +11,6 @@ node_modules
npm-debug.log
# Docker files
Dockerfile
docker-compose.yml
.dockerignore
# Other

4
.gitignore vendored
View File

@ -8,6 +8,4 @@ node_modules/
*.log
# Docker Files
Dockerfile
docker-compose.yml
discord-bot.tar
discord-bot.tar

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
# Use Node.js LTS version
FROM node:20-slim
# Create app directory
WORKDIR /usr/src/app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Start the bot
CMD [ "node", "index.js" ]

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
version: '3.8'
services:
discord-bot:
build: .
container_name: discord-bot
restart: unless-stopped
env_file:
- .env