feat: add Docker deployment configuration

This commit is contained in:
sokol
2026-02-18 23:12:11 +03:00
parent 18193b71c1
commit 0fe61acfe7
6 changed files with 603 additions and 0 deletions

39
Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
# Build stage
FROM node:20-alpine AS build
WORKDIR /app
# Install git
RUN apk add --no-cache git
# Clone repository
ARG GIT_URL=https://git.six83.ru/ssa/configucci.git
ARG GIT_BRANCH=ai
RUN git clone --depth 1 --branch ${GIT_BRANCH} ${GIT_URL} .
# Install dependencies
COPY package*.json ./
RUN npm ci
# Copy source and build
COPY . .
RUN npm run build
# Production stage
FROM nginx:alpine
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built files from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
# Start nginx
CMD ["nginx", "-g", "daemon off;"]