Skip to content

Commit 8e90a62

Browse files
committed
add docker
1 parent 8c3db05 commit 8e90a62

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nore_modules

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Use the official Node.js image as a build stage
2+
FROM node:20 AS build
3+
4+
# Set the working directory
5+
WORKDIR /app
6+
7+
# Copy package.json and package-lock.json (if available)
8+
COPY package*.json ./
9+
10+
# Install dependencies
11+
RUN npm install
12+
13+
# Copy the rest of the application files
14+
COPY . .
15+
16+
# Build the Vite app for production
17+
RUN npm run build
18+
19+
# Use nginx to serve the app
20+
FROM nginx:alpine
21+
22+
# Copy the build output to nginx's html directory
23+
COPY --from=build /app/dist /usr/share/nginx/html
24+
25+
# Expose port 80
26+
EXPOSE 80
27+
28+
# Start nginx
29+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)