-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 850 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 850 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
# Use official Node.js LTS image
FROM node:18-alpine
# Install cloudflared
RUN apk add --no-cache curl && \
curl -L --output /usr/local/bin/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && \
chmod +x /usr/local/bin/cloudflared
# Set working directory
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm ci --only=production && npm cache clean --force
# Copy application files
COPY . .
# Create uploads directory structure
RUN mkdir -p uploads/pasted uploads/bin
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000', (res) => process.exit(res.statusCode === 401 ? 0 : 1))"
# Start application
CMD ["node", "server.js"]