Add Dockerfile
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
# ----- Stage 1: Build Angular SSR App -----
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm ci
|
||||
|
||||
# Copy the rest of the code
|
||||
COPY . .
|
||||
|
||||
# Build the Angular app for production
|
||||
RUN npm run build
|
||||
|
||||
# ----- Stage 2: Serve SSR App -----
|
||||
FROM node:22-alpine AS final
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the built assets from the build stage.
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
EXPOSE 4000
|
||||
|
||||
CMD ["node", "/app/dist/Ynex-Tailwind/server/main.js"]
|
||||
Reference in New Issue
Block a user