Files
bamort/docker/Dockerfile.frontend
T

31 lines
668 B
Docker
Raw Normal View History

# =========== 1) Build stage ===========
2025-12-26 08:45:47 +01:00
FROM node:22-alpine AS build
WORKDIR /usr/src/app
2025-12-26 08:45:47 +01:00
# Copy package files
COPY package*.json ./
2025-12-26 08:45:47 +01:00
# Install dependencies
RUN npm install
# Copy the rest of the frontend code
COPY . .
# Build the production bundle
RUN npm run build
# =========== 2) Serve stage ===========
FROM nginx:alpine
# Copy production build to Nginx html folder.
# Adjust /usr/src/app/build -> /usr/src/app/dist if youre using Angular/Vue
2025-01-03 15:51:41 +01:00
#COPY --from=build /usr/src/app/build /usr/share/nginx/html
2025-12-26 08:45:47 +01:00
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
# Expose HTTP port
EXPOSE 80
# Run Nginx in foreground
CMD ["nginx", "-g", "daemon off;"]