-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 811 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 811 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
# Use an official Node.js runtime as a parent image
FROM node:20-alpine AS build-stage
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application to the working directory
COPY . .
# Build the Vue.js application for production
RUN npm run build
# Use an official Nginx image as the second stage
FROM nginx:stable-alpine AS production-stage
# Copy the build output from the previous stage to Nginx's html directory
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Copy the Nginx configuration file
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Command to run Nginx
CMD ["nginx", "-g", "daemon off;"]