Spaces:
Sleeping
Sleeping
# Step 1: Build the Angular app | |
# Use a Node.js image to build the Angular project | |
FROM node:18 AS build | |
# Set the working directory inside the container | |
WORKDIR /app | |
# Copy package.json and package-lock.json to the working directory | |
COPY package*.json ./ | |
# Install dependencies | |
RUN npm install | |
# Copy the rest of the application code | |
COPY . . | |
# Fix for OpenSSL issue | |
ENV NODE_OPTIONS=--openssl-legacy-provider | |
# Build the Angular project (no --prod flag) | |
RUN npm run build -- --output-path=dist/AiQA-Web --configuration production | |
# Step 2: Serve the Angular app with NGINX | |
FROM nginx:alpine | |
# Copy the build output to NGINX's default location | |
COPY --from=build /app/dist/AiQA-Web /usr/share/nginx/html | |
# Expose port 80 | |
EXPOSE 80 | |
# Start NGINX | |
CMD ["nginx", "-g", "daemon off;"] | |