Some checks failed
CICD / Build CICD Image Failure Postmortem (push) Has been cancelled
CICD / Source Checks (push) Has been cancelled
CICD / Dependency Audits (Informational) (push) Has been cancelled
CICD / CICD Tests Complete (push) Has been cancelled
CICD / Build Release Images (push) Has been cancelled
CICD / Build Tester Images (push) Has been cancelled
CICD / Production Images Complete (push) Has been cancelled
CICD / Production Image Failures Postmortem (push) Has been cancelled
CICD / Source Lanes Failure Postmortem (push) Has been cancelled
CICD / Runtime Black-Box Integration Tests (push) Has been cancelled
CICD / Integration Tests Failure Postmortem (push) Has been cancelled
CICD / End-to-End Tests (push) Has been cancelled
CICD / E2E Tests Failure Postmortem (push) Has been cancelled
CICD / Promote Staging Images To Release (push) Has been cancelled
CICD / Build and Push CICD Images (push) Has been cancelled
43 lines
881 B
Docker
43 lines
881 B
Docker
# Frontend Dockerfile for Vue/Vite TypeScript project
|
|
ARG NODE_ALPINE_TAG=24-alpine
|
|
ARG YARN_VERSION=4.17.1
|
|
FROM node:${NODE_ALPINE_TAG} AS deps
|
|
|
|
ARG YARN_VERSION
|
|
|
|
WORKDIR /app
|
|
|
|
COPY frontend/package.json frontend/yarn.lock frontend/.yarnrc.yml ./
|
|
RUN set -eux; \
|
|
retry() { \
|
|
attempts="$1"; shift; \
|
|
n=1; \
|
|
while [ "$n" -le "$attempts" ]; do \
|
|
if "$@"; then \
|
|
return 0; \
|
|
fi; \
|
|
if [ "$n" -lt "$attempts" ]; then \
|
|
sleep "$((3 * n))"; \
|
|
fi; \
|
|
n=$((n + 1)); \
|
|
done; \
|
|
return 1; \
|
|
}; \
|
|
corepack enable; \
|
|
retry 5 corepack prepare yarn@${YARN_VERSION} --activate; \
|
|
retry 5 yarn install --immutable
|
|
|
|
FROM deps AS build
|
|
|
|
COPY frontend/ .
|
|
RUN yarn build
|
|
|
|
FROM nginx:alpine AS production
|
|
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY frontend/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|