We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0a66e78 + 65422aa commit 32ddfbaCopy full SHA for 32ddfba
2 files changed
Dockerfile
@@ -0,0 +1,25 @@
1
+# Build stage
2
+FROM node:18-alpine as build
3
+
4
+WORKDIR /app
5
6
+COPY package*.json ./
7
+RUN npm ci
8
9
+COPY . .
10
11
+# Accept API URL at build time
12
+ARG VITE_API_BASE_URL
13
+ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
14
15
+RUN npm run build
16
17
+# Production stage
18
+FROM nginx:alpine
19
20
+COPY --from=build /app/dist /usr/share/nginx/html
21
+COPY nginx.conf /etc/nginx/conf.d/default.conf
22
23
+EXPOSE 80
24
25
+CMD ["nginx", "-g", "daemon off;"]
nginx.conf
@@ -0,0 +1,9 @@
+server {
+ listen 80;
+ location / {
+ root /usr/share/nginx/html;
+ index index.html index.htm;
+ try_files $uri $uri/ /index.html;
+ }
+}
0 commit comments