-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (31 loc) · 1.2 KB
/
Dockerfile
File metadata and controls
33 lines (31 loc) · 1.2 KB
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
FROM node:lts-alpine as build-stage
# Define build arguments for environment variables
ARG VITE_API_BASE_URL
ARG VITE_API_KEY
ARG VITE_FACEBOOK_APP_ID
ARG VITE_GOOGLE_CLIENT_ID
ARG VITE_GOOGLE_CONNECT_CLIENT_ID
# Set environment variables during the build process
ENV VITE_API_URL=https://achat-api.whitemage.fun/api
ENV VITE_API_BASE_URL=https://achat-api.whitemage.fun
ENV VITE_FACEBOOK_APP_ID=1112531290010177
ENV VITE_GOOGLE_CLIENT_ID=35933257036-qto3kbo0s1f0702skb4ekaoero4c5qi8.apps.googleusercontent.com
ENV VITE_GOOGLE_CONNECT_CLIENT_ID=35933257036-qto3kbo0s1f0702skb4ekaoero4c5qi8.apps.googleusercontent.com
# install simple http server for serving static content
RUN npm install -g http-server
# make the 'app' folder the current working directory
WORKDIR /app
# copy 'package.json' to install dependencies
COPY package*.json ./
# install dependencies
RUN npm install
# copy files and folders to the current working directory (i.e. 'app' folder)
COPY . .
# build app for production with minification
RUN npm run build-only
FROM nginx:stable-alpine as production-stage
COPY nginx.conf /etc/nginx/conf.d
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]