This commit is contained in:
2026-03-19 16:12:22 +07:00
parent 39b0358b08
commit b7e8450357
11 changed files with 101 additions and 68 deletions

4
frontend/.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
node_modules
dist
npm-debug.log
Dockerfile

View File

@@ -1,4 +1,4 @@
FROM node:22-alpine AS build
FROM node:22-alpine AS deps
WORKDIR /app
@@ -6,6 +6,16 @@ COPY package.json package.json
COPY vite.config.js vite.config.js
RUN npm install
FROM node:22-alpine AS build
WORKDIR /app
ARG VITE_API_BASE_URL=http://localhost:4000/api
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
COPY --from=deps /app/node_modules node_modules
COPY package.json package.json
COPY vite.config.js vite.config.js
COPY public public
COPY src src
COPY index.html index.html
@@ -14,5 +24,6 @@ RUN npm run build
FROM nginx:1.27-alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

17
frontend/nginx.conf Normal file
View File

@@ -0,0 +1,17 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location = /health {
access_log off;
return 200 "ok\n";
add_header Content-Type text/plain;
}
}