-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 865 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Use Node.js 24+ for native TypeScript support
FROM node:24-alpine
# Set working directory
WORKDIR /app
# Create a non-root user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
# Copy package files
COPY package.json package-lock.json* ./
# Install dependencies
RUN npm ci --only=production && \
npm cache clean --force
# Copy source code and type definitions
COPY src/ ./src/
COPY types/ ./types/
COPY data/ ./data/
COPY tsconfig.json ./
# Change ownership to non-root user
RUN chown -R nodejs:nodejs /app
# Switch to non-root user
USER nodejs
# Health check
# TODO: Make the bot expose an HTTP endpoint for this
# HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \
# ADD CMD FOR HEALTHCHECK HERE (e.g. curl -f http://localhost:3000/health || exit 1)
# Run the bot
CMD ["node", "src/bot.ts"]