-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 741 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (22 loc) · 741 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
# Stage 1: Build the React app
FROM node:22 AS build
WORKDIR /app
# No longer need Build-time ARGs for these specific variables
# as they are now handled at runtime by entrypoint.sh
COPY package.json ./
RUN npm install && npm rebuild lightningcss rollup
COPY . .
RUN npm run build
# Stage 2: Serve the app with Nginx
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
# REQUIRED for SPAs: Copy a custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy build files
COPY --from=build /app/dist /usr/share/nginx/html
# Copy entrypoint script and make it executable
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 22222
# Use the entrypoint script to jumpstart the app
ENTRYPOINT ["/entrypoint.sh"]