Add Docker, Nginx, and Gitea workflow configuration
All checks were successful
Deploy to Production / deploy (push) Successful in 7s

This commit is contained in:
2026-02-26 22:14:05 +00:00
parent 1dcfbd1bd9
commit bdbb561740
5 changed files with 133 additions and 0 deletions

36
Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
# Stage 1: Build the application
FROM node:lts-alpine as build-stage
# Set working directory
WORKDIR /app
# Copy package files first to leverage Docker cache
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Stage 2: Serve the application with Nginx
FROM nginx:stable-alpine as production-stage
# Copy the built artifacts from the build stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Healthcheck to ensure Nginx is running and serving
HEALTHCHECK --interval=30s --timeout=3s \
CMD wget --quiet --tries=1 --spider http://localhost/health || exit 1
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]