small prod changes
All checks were successful
Release Build / build-docker (push) Successful in 43s
Release Build / build-android-and-release (push) Successful in 2m11s

This commit is contained in:
Rene Kievits
2025-12-24 16:20:44 +01:00
parent ac225b5b41
commit e1bf8f2032
9 changed files with 93 additions and 41 deletions

View File

@@ -1,15 +1,31 @@
FROM node:24-alpine AS dev-stage
# Stage 1: Build the Application
FROM node:20-alpine AS build-stage
WORKDIR /app
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:20-alpine AS dev-stage
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host"]
FROM dev-stage AS build-stage
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
RUN npm run build
FROM nginx:alpine AS production-stage
RUN mkdir -p /run/nginx
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>Zen Kanji</title>
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico">
<link rel="icon" type="image/x-icon" href="/src/assets/favicon.ico">
</head>
<body>

16
client/nginx.conf Normal file
View File

@@ -0,0 +1,16 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public, no-transform";
}
}

View File

@@ -18,15 +18,15 @@ export default defineConfig(({ mode }) => {
},
server: {
allowedHosts: [
env.VITE_HOST,
'localhost',
],
host: true,
port: 5173,
strictPort: true,
hmr: {
host: env.VITE_HOST,
protocol: 'wss',
clientPort: 443,
host: 'localhost',
protocol: 'ws',
clientPort: 5173,
},
},
};