From a940e02f7532673491304e7f6e0454553f774070 Mon Sep 17 00:00:00 2001 From: chyoo Date: Tue, 7 Jul 2026 17:32:44 +0900 Subject: [PATCH] add dockerfile for lms adm frontend build --- Dockerfile | 15 +++++++++++++++ nginx.conf | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2acf836 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:22-alpine AS builder +WORKDIR /app + +COPY package*.json ./ +RUN npm ci + +COPY . . +RUN npm run build + +FROM nginx:1.27-alpine +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /app/dist /usr/share/nginx/html + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..28b58d8 --- /dev/null +++ b/nginx.conf @@ -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; + add_header Content-Type text/plain; + return 200 "ok\n"; + } +}