chore(docker): optimize Dockerfiles and add healthchecks for Coolify deployment

- Add build arguments and environment variables for OAuth client IDs in frontend Dockerfile
- Install wget and add HEALTHCHECK commands to frontend and backend Dockerfiles
- Create non-root user in backend Dockerfile for improved security
- Update docker-compose.yml with healthcheck configurations and dynamic port/environment variable support
- Add network configuration and restart policies to docker-compose services
- Expand .env.example with additional OAuth secrets, ports, and environment variables for Coolify
- Enhance README.md with detailed Coolify deployment instructions and required environment variables table
This commit is contained in:
MUIS1436
2026-01-31 11:06:16 +05:00
parent d5cb1ded3e
commit ab10baf983
5 changed files with 125 additions and 10 deletions

View File

@@ -1,8 +1,18 @@
# Frontend Dockerfile
# Frontend Dockerfile (Coolify Optimized)
FROM node:20-alpine AS builder
WORKDIR /app
# Build arguments for environment variables
ARG VITE_MS_CLIENT_ID
ARG VITE_GOOGLE_CLIENT_ID
ARG VITE_API_URL
# Set as environment variables for build
ENV VITE_MS_CLIENT_ID=$VITE_MS_CLIENT_ID
ENV VITE_GOOGLE_CLIENT_ID=$VITE_GOOGLE_CLIENT_ID
ENV VITE_API_URL=$VITE_API_URL
# Copy package files
COPY package*.json ./
@@ -18,6 +28,9 @@ RUN npm run build
# Production stage
FROM nginx:alpine
# Install wget for healthcheck
RUN apk add --no-cache wget
# Copy built assets
COPY --from=builder /app/dist /usr/share/nginx/html
@@ -26,4 +39,7 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget -q --spider http://localhost:80 || exit 1
CMD ["nginx", "-g", "daemon off;"]