-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (41 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
57 lines (41 loc) · 1.21 KB
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
49
50
51
52
53
54
55
56
57
# Build stage
FROM node:22.18.0-alpine3.21 AS builder
# Set working directory
WORKDIR /app
# Enable corepack and set yarn version
RUN corepack enable && corepack prepare yarn@4.6.0 --activate
# Copy the entire repository
COPY . .
# Install dependencies
RUN yarn install
# Build all packages
RUN yarn build
#
# Production stage
#
FROM node:22.18.0-alpine3.21 AS runner
# Set working directory
WORKDIR /app
# Add jq for json log parsing
RUN apk add --no-cache jq
# Enable corepack and set yarn version
RUN corepack enable && corepack prepare yarn@4.6.0 --activate
# Copy built files from builder stage
COPY --from=builder /app .
# Install production dependencies; skipped build steps as code is already built
RUN yarn install --mode=skip-build
# Set environment variables
ENV NODE_ENV=production
# Add specific ARGs and persist them into ENV
ARG DATABASE_URL
ENV DATABASE_URL=$DATABASE_URL
# Datadog tracing configuration (can be overridden at runtime)
ENV SERVICE_NAME=vaults-backend
ENV DATADOG_AGENT_URL=http://localhost:8126
ENV PONDER_TELEMETRY_DISABLED=true
# Expose port
EXPOSE 3000
# pass command as argument
COPY ./bin/entrypoint.sh entrypoint.sh
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]