-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (28 loc) · 858 Bytes
/
Dockerfile
File metadata and controls
41 lines (28 loc) · 858 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
# Use the official Node.js image to build the app
FROM node:18 AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json ./
COPY pnpm-lock.yaml ./
# Install dependencies
RUN npm install -g pnpm
RUN pnpm install
# Copy the rest of the application code
COPY . .
# Pass environment variables during the build process
ARG BUILD_SCRIPT=build:testnet
ARG VITE_HASH
ENV VITE_HASH=${VITE_HASH}
# Build the application and handle non-root
RUN yarn ${BUILD_SCRIPT}
# Use the official nginx image for serving static files
FROM nginx:alpine
# Copy the build output to the nginx html directory
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy the nginx configuration file
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]