-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (24 loc) · 792 Bytes
/
Dockerfile
File metadata and controls
34 lines (24 loc) · 792 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
# Use Playwright image that already includes browsers + Node
FROM mcr.microsoft.com/playwright:v1.49.0-jammy
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --omit=dev
# Copy application files
COPY . .
# Create non-root user for security
RUN groupadd -r renderer && useradd -r -g renderer renderer && \
chown -R renderer:renderer /app
# Switch to non-root user
USER renderer
# Expose port
EXPOSE 3000
# Set environment to production
ENV NODE_ENV=production
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start the server
CMD ["node", "server.js"]