build: add Docker multi-stage build with nginx

This commit is contained in:
ahp
2026-08-25 21:09:05 +03:30
parent c34752d1b0
commit fa5da9c509
3 changed files with 95 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
FROM node:24-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm clean-install --verbose
COPY . .
RUN npm run build --verbose
FROM nginx:stable-alpine
RUN apk add --no-cache curl
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/dist /usr/share/nginx/html
COPY ./config/nginx/nginx.conf /etc/nginx/conf.d/default.conf
RUN chown -R nginx:nginx /usr/share/nginx/html && \
chmod -R 755 /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost/ || exit 1
CMD ["nginx", "-g", "daemon off;"]
+15
View File
@@ -0,0 +1,15 @@
services:
kawaii-app:
build:
context: ..
dockerfile: docker/Dockerfile
container_name: kawaii-web
ports:
- "8181:80"
restart: unless-stopped
networks:
- kawaii-network
networks:
kawaii-network:
driver: bridge