forked from spacesprotocol/explorer
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (23 loc) · 678 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (23 loc) · 678 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
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# Accept build-time argument for network configuration
ARG PUBLIC_BTC_NETWORK=mainnet
ARG MARKETPLACE_URI
# Set as environment variable for build
ENV PUBLIC_BTC_NETWORK=$PUBLIC_BTC_NETWORK
ENV MARKETPLACE_URI=$MARKETPLACE_URI
RUN npm run build
FROM node:20-alpine
WORKDIR /app
# Copy built assets from builder
COPY --from=builder /app/build ./build
COPY --from=builder /app/package*.json ./
# Install production dependencies only
RUN npm ci --production
# Expose the port your app runs on
EXPOSE 3000
# Use an entrypoint script to handle environment variables
CMD ["node", "build"]