forked from Pustur/whatsapp-chat-parser-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
30 lines (21 loc) Β· 711 Bytes
/
dockerfile
File metadata and controls
30 lines (21 loc) Β· 711 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
# Stage 1: Build the React application using Vite
FROM node:18 AS build
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json (if available)
COPY package*.json ./
# Install npm globally and install all dependencies, including devDependencies
RUN npm install -g [email protected]
RUN npm install
# Copy the rest of your application code
COPY . .
# Build the application for production
RUN npm run build
# Stage 2: Serve the application using Nginx (optional)
FROM nginx:alpine
# Copy the build output to Nginx's html directory
COPY --from=build /app/build /usr/share/nginx/html
# Expose the port Nginx will use
EXPOSE 4000
# Command to run Nginx
CMD ["nginx", "-g", "daemon off;"]