-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.render
More file actions
43 lines (31 loc) · 937 Bytes
/
Dockerfile.render
File metadata and controls
43 lines (31 loc) · 937 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
37
38
39
40
41
42
43
# Use Node.js 18 for better compatibility with Render
FROM node:18-alpine
# Install curl for health checks
RUN apk add --no-cache curl
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json ./
COPY package-lock.json ./
# Clear npm cache and install with fallback
RUN npm cache clean --force && \
(npm ci --only=production || npm install --only=production)
# Copy source code
COPY . .
# Install dev dependencies and build
RUN npm install && npm run build
# Remove dev dependencies
RUN npm prune --production
# Expose port
EXPOSE 3002
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3002/telegram/health || exit 1
# Create non-root user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S aical -u 1001
# Change ownership
RUN chown -R aical:nodejs /app
USER aical
# Start the application
CMD ["npm", "run", "start:prod"]