Files
Randall/cicd/docker/Dockerfile.frontend
Robert van Diest 72751f6491 fix(docker): prefix compose image names with localhost to prevent Docker Hub lookups
randall/frontend and randall/backend were being resolved as docker.io
paths, causing unwanted registry auth attempts. The localhost/ prefix
marks them as local-only images. Also restores docker/setup-buildx-action
with the docker driver, and reverts the ECR Public mirror workaround
since it was never the root cause.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 17:02:40 +01:00

26 lines
739 B
Docker

# Build stage
FROM node:22-alpine AS build
WORKDIR /app
# Install dependencies — copy lockfiles first to cache the npm layer
COPY src/frontend/package.json src/frontend/package-lock.json ./
RUN --mount=type=cache,id=npm,target=/root/.npm \
npm ci --prefer-offline
# Copy source
COPY src/frontend/index.html ./
COPY src/frontend/vite.config.ts ./
COPY src/frontend/tsconfig.json src/frontend/tsconfig.app.json src/frontend/tsconfig.node.json ./
COPY src/frontend/eslint.config.js ./
COPY src/frontend/src/ ./src/
COPY src/frontend/public/ ./public/
RUN npm run build
# Serve stage
FROM nginx:alpine AS runtime
COPY --from=build /app/dist /usr/share/nginx/html
COPY cicd/docker/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80