Add frontend

This commit is contained in:
pratik
2025-10-23 08:10:15 -05:00
parent 23dacdd0c2
commit c35cd7092a
28 changed files with 2243 additions and 4 deletions

33
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# Stage 1: Build Angular app
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build Angular app for production
RUN npm run build:prod
# Stage 2: Serve with nginx
FROM nginx:alpine
# Copy custom nginx config
COPY nginx.conf /etc/nginx/nginx.conf.template
# Copy built Angular app
COPY --from=builder /app/dist/cf-deployer-ui/browser /usr/share/nginx/html
# Set default backend URL
ENV BACKEND_URL=http://localhost:8080
# Replace env variables and start nginx
CMD envsubst '${BACKEND_URL}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'
EXPOSE 80