Files
delivery-tracker/frontend/Dockerfile
Egor Pozharov f9c54b5172
Some checks failed
Build and Push Docker Images / build-backend (push) Has been cancelled
Build and Push Docker Images / build-frontend (push) Has been cancelled
add build version tracking with commit SHA, version number, and build timestamp to frontend
2026-05-04 16:08:37 +06:00

33 lines
543 B
Docker

# syntax=docker/dockerfile:1
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
ARG GITEA_SHA
ARG COMMIT_SHA
# Copy package files
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Copy source code
COPY . .
# Build application
RUN yarn build
# Stage 2: Production
FROM nginx:alpine AS production
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built files from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]