mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
- Removed VITE_APP_VERSION from Dockerfile and GitHub workflows. - Simplified Vite configuration by eliminating the Git version retrieval function and global constant for app version. - Updated ColorPicker and other components to enhance accessibility with aria-labels. - Introduced unique identifiers for buttons in the AppEditorModal for better React key management. - Improved error handling in the Login component to provide user-friendly messages without exposing sensitive data.
43 lines
1023 B
Docker
43 lines
1023 B
Docker
# Stage 1: Build the React application
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package.json package-lock.json* ./
|
|
|
|
# Install dependencies
|
|
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build arguments for environment variables
|
|
ARG VITE_API_URL=/api
|
|
ARG VITE_TELEGRAM_BOT_USERNAME
|
|
ARG VITE_APP_NAME=Cabinet
|
|
ARG VITE_APP_LOGO=V
|
|
|
|
# Set environment variables for build
|
|
ENV VITE_API_URL=$VITE_API_URL
|
|
ENV VITE_TELEGRAM_BOT_USERNAME=$VITE_TELEGRAM_BOT_USERNAME
|
|
ENV VITE_APP_NAME=$VITE_APP_NAME
|
|
ENV VITE_APP_LOGO=$VITE_APP_LOGO
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# Stage 2: Serve with Nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copy built assets from builder stage
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Expose port
|
|
EXPOSE 80
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1
|