-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (23 loc) · 736 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (23 loc) · 736 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
FROM node:24-alpine
WORKDIR /app
# Update npm to latest version to fix vulnerabilities
RUN npm install -g npm@latest
# Copy package files
COPY package*.json ./
# Install production dependencies only
RUN npm ci --only=production
# Copy source code
COPY . .
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
USER nodejs
# Expose OTLP receiver port
EXPOSE 4318
# Set default environment for Docker container
ENV OTLP_RECEIVER_HOST=0.0.0.0
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:4318/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
# Start server
CMD ["node", "src/server.js"]