updated
This commit is contained in:
31
Dockerfile.prod
Normal file
31
Dockerfile.prod
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
|
||||
FROM node:20.11.1 AS builder
|
||||
|
||||
ENV VITE_BASE_URL="http://192.168.1.204:9510"
|
||||
ENV VITE_PRINT_URL="http://192.168.1.204:9512"
|
||||
ENV VITE_MONEY_URL="http://192.168.1.204:9513"
|
||||
ENV VITE_AUTO_URL="http://192.168.1.204:9514"
|
||||
ENV VITE_COMPANY_ID="1"
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json .
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
RUN npm prune --production
|
||||
|
||||
|
||||
|
||||
|
||||
FROM nginx:stable-alpine as production-stage
|
||||
ENV NODE_ENV=production
|
||||
# Copy the build application from the previous stage to the Nginx container
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
# Copy the nginx configuration file
|
||||
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
# Expose the port 80
|
||||
EXPOSE 80
|
||||
# Start Nginx to serve the application
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user