Files
planet/frontend/Dockerfile
T
linkong 842cba4dc7
ci / backend (push) Has been cancelled
ci / frontend (push) Has been cancelled
release / images (push) Has been cancelled
release / client_release (push) Has been cancelled
ci / delivery (push) Has been cancelled
release: bump version to 0.77.0
2026-11-20 16:59:38 +08:00

33 lines
1.0 KiB
Docker

ARG BUN_IMAGE=oven/bun:1-alpine
ARG NGINX_IMAGE=nginx:1.27-alpine
FROM ${BUN_IMAGE} AS build
WORKDIR /app
ARG BUN_CONFIG_REGISTRY=""
COPY package.json bun.lock ./
RUN if [ -n "$BUN_CONFIG_REGISTRY" ]; then BUN_CONFIG_REGISTRY="$BUN_CONFIG_REGISTRY" bun install --frozen-lockfile; else bun install --frozen-lockfile; fi
COPY . .
ARG PLANET_FRONTEND_TARGET=full
ENV PLANET_FRONTEND_TARGET=${PLANET_FRONTEND_TARGET}
RUN if [ "$PLANET_FRONTEND_TARGET" = "admin" ]; then bun run build:admin; else bun run build; fi
FROM ${NGINX_IMAGE}
ENV PLANET_BACKEND_UPSTREAM=planet-backend:8000
ENV NGINX_ENVSUBST_FILTER=PLANET_BACKEND_UPSTREAM
COPY nginx.conf.template /etc/nginx/templates/default.conf.template
COPY --from=build /app/dist /usr/share/nginx/html
ARG ADMIN_BUILD_FINGERPRINT=unknown
LABEL planet.admin.build-fingerprint="${ADMIN_BUILD_FINGERPRINT}"
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD wget -qO- http://127.0.0.1:3000/health >/dev/null || exit 1
CMD ["nginx", "-g", "daemon off;"]