Create Dockerfile for Discord bot on Spaceship
cgen-1e87602c28c04011b924a79f6b69f338
This commit is contained in:
parent
a1ed5a4356
commit
047af505d4
1 changed files with 22 additions and 0 deletions
22
discord-bot/Dockerfile
Normal file
22
discord-bot/Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
FROM node:18-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install --production
|
||||
|
||||
# Copy bot source
|
||||
COPY . .
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD node -e "require('http').get('http://localhost:3000/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"
|
||||
|
||||
# Start bot
|
||||
CMD ["npm", "start"]
|
||||
Loading…
Reference in a new issue