-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (35 loc) · 948 Bytes
/
Dockerfile
File metadata and controls
48 lines (35 loc) · 948 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
44
45
46
47
48
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files from backend
COPY backend/package*.json ./
# Install dependencies
RUN npm ci --only=production
# Production stage
FROM node:20-alpine
WORKDIR /app
# Install runtime dependencies
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont
# Puppeteer configuration
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
# Copy dependencies from builder
COPY --from=builder /app/node_modules ./node_modules
# Copy backend application code
COPY --chown=nodejs:nodejs backend/ .
# Switch to non-root user
USER nodejs
# Expose port (Railway overrides with $PORT env var)
EXPOSE 5000
# Use startup script with explicit logging
CMD ["sh", "./start.sh"]