diff --git a/Dockerfile b/Dockerfile index 6c876c59..fd279028 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# ----- Stage 1: Build Angular SSR App ----- +# ----- Stage 1: Build Angular App ----- FROM node:22-alpine AS build WORKDIR /app @@ -14,14 +14,14 @@ COPY . . # Build the Angular app for production RUN npm run build -# ----- Stage 2: Serve SSR App ----- -FROM node:22-alpine AS final +# ----- Stage 2: Serve Angular App with Nginx ----- +FROM nginx:alpine -WORKDIR /app +# Copy the built assets from the build stage into Nginx's default HTML folder +COPY --from=build /app/preview /usr/share/nginx/html -# Copy the built assets from the build stage. -COPY --from=build /app/preview ./dist +# Expose standard HTTP port 80 +EXPOSE 80 -EXPOSE 4000 - -CMD ["node", "/app/dist/Ynex-Tailwind/server/main.js"] \ No newline at end of file +# Start Nginx in the foreground +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file