-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 831 Bytes
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 831 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
FROM node:20.20.0-alpine3.22 AS builder
WORKDIR /app
ENV DOCKER=true
# Copy package files and install dependencies
COPY package*.json ./
RUN npm ci
# Copy source code AND bin directory
COPY tsconfig.json ./
COPY bin/ ./bin/
COPY src/ ./src/
# Build the application
RUN npm run build
# Start a new stage for a smaller production image
FROM node:20.20.0-alpine3.22
WORKDIR /app
# Set environment variables
ENV DOCKER=true
ENV NODE_ENV=production
ENV FLW_SECRET_KEY=${FLW_SECRET_KEY}
# Copy package files and install production dependencies only
COPY package*.json ./
RUN npm ci --omit=dev
# Copy the built application from the builder stage
COPY --from=builder /app/build ./build
# Run the application
CMD ["node", "build/index.js", "--tools=create_checkout,disable_checkout,read_transaction,resend_transaction_webhook"]