Updated dockerfile

This commit is contained in:
2024-05-16 14:37:21 -04:00
parent d48caeae63
commit 0a1b755253
3 changed files with 39 additions and 5 deletions

29
Dockerfile.prod Normal file
View File

@@ -0,0 +1,29 @@
FROM node:20.11.1 AS builder
ENV VITE_BASE_URL="http://localhost:9510"
ENV VITE_PRINT_URL="http://localhost:9512"
ENV VITE_MONEY_URL="http://localhost:9513"
ENV VITE_AUTO_URL="http://localhost: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;"]

View File

@@ -9,11 +9,7 @@
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
<link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="icon" type="image/ico" href="favicon.ico">
</head>
<body>
<!-- quasar:entry-point -->

9
nginx/default.conf Normal file
View File

@@ -0,0 +1,9 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
}