This commit is contained in:
K Car
2025-07-10 08:27:30 +01:00
commit a7de5af021
15 changed files with 332 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
# Build stage
FROM node:20-alpine as builder
WORKDIR /app
# Enable corepack and set up Yarn 4.8.0 before copying files
RUN corepack enable
RUN corepack prepare [email protected] --activate
# Copy package files
COPY package.json yarn.lock ./
COPY whisperlive-frontend/package.json ./whisperlive-frontend/
# Now run yarn install
RUN yarn install
# Copy source files
COPY whisperlive-frontend ./whisperlive-frontend
# Build the application
RUN yarn workspace whisperlive-frontend build
# Production stage
FROM nginx:alpine
# Create SSL directory
RUN mkdir -p /etc/nginx/ssl
# Create a win/macos switcher
ARG BUILD_OS
ENV BUILD_OS=${BUILD_OS}
ARG NGINX_MODE
ENV NGINX_MODE=${NGINX_MODE}
# Copy nginx configuration
COPY whisperlive-frontend/nginx/nginx-${BUILD_OS}-${NGINX_MODE:-dev}.conf /etc/nginx/conf.d/default.conf
# Copy built files from builder
COPY --from=builder /app/whisperlive-frontend/dist /usr/share/nginx/html
# Start nginx
CMD ["nginx", "-g", "daemon off;"]