forked from NethermindEth/simple-surge-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.bridge-ui
More file actions
44 lines (29 loc) · 854 Bytes
/
Dockerfile.bridge-ui
File metadata and controls
44 lines (29 loc) · 854 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
# Step 1: Build the application
FROM node:20 AS builder
RUN npm install -g pnpm
WORKDIR /app
# Install dependencies
COPY ./surge-taiko-mono/packages/bridge-ui/package.json ./
# Copy the app source code and build
COPY ./surge-taiko-mono/packages/bridge-ui .
COPY ./configs/*.json ./config/
RUN cp .env.example .env
RUN pnpm export:config
# Install dependencies without the lock file, generating a new one
RUN pnpm install
RUN pnpm build
# Step 2: Set up the final production environment
FROM node:20
# Install pnpm globally
RUN npm install -g pnpm
WORKDIR /app
# Copy only necessary build files
COPY --from=builder /app/package.json ./
COPY --from=builder /app/pnpm-lock.yaml ./
RUN pnpm install --prod
# Copy the build output
COPY --from=builder /app/build ./build
# Expose port
EXPOSE 3000
# Start the SvelteKit app
CMD ["node", "build"]