Files
bamort/docker/Dockerfile.frontend
T

28 lines
614 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# =========== 1) Build stage ===========
FROM node:18-alpine AS build
WORKDIR /usr/src/app
# Copy package manifests and install dependencies
COPY package*.json ./
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
COPY --from=build /usr/src/app/build /usr/share/nginx/html
# Expose HTTP port
EXPOSE 80
# Run Nginx in foreground
CMD ["nginx", "-g", "daemon off;"]