Files
pipu-music/apps/web/Dockerfile
T
mrleo1nidandClaude Opus 5.5 633a8f79af
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 1m41s
ci / ts / ts (packages + web) (push) Successful in 52s
ci / docker / docker (образы собираются — их сервер собирает сам при обновлении) (push) Successful in 21s
ci: cache turbo, npx and Metro; install web deps before copying code
- ci-ts restores the local turbo cache, so unchanged packages skip
  typecheck, test and build
- ci-mobile caches the npx copy of expo-doctor and Metro's transform cache
- the web image copies only workspace manifests before pnpm install, so the
  dependency layer survives code changes (CI docker job and update.sh)
- docs: table of what is cached where

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:24:29 +03:00

31 lines
1.7 KiB
Docker

# syntax=docker/dockerfile:1
# Образ `web` = nginx + собранная SPA + конфиг (TLS, прокси на api, X-Accel-раздача аудио).
# Сборка из корня репозитория: docker build -f apps/web/Dockerfile --build-arg VERSION=1.2.3 .
FROM node:22-alpine AS build
RUN npm install -g pnpm@11.9.0
WORKDIR /repo
# Сначала только манифесты workspace: слой с установкой зависимостей пересобирается лишь при их изменении,
# а не при любой правке кода. Новый пакет в apps/ или packages/ — добавить его package.json сюда.
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/web/package.json apps/web/
COPY apps/mobile/package.json apps/mobile/
COPY packages/api-client/package.json packages/api-client/
COPY packages/core/package.json packages/core/
COPY packages/design-tokens/package.json packages/design-tokens/
COPY packages/i18n/package.json packages/i18n/
RUN --mount=type=cache,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile --filter @pipu/web...
COPY . .
# Сгенерированные клиенты и токены лежат в репозитории (их актуальность проверяет CI), поэтому generate здесь не нужен.
RUN pnpm --filter @pipu/web build
FROM nginx:1.28-alpine
COPY deploy/nginx/default.conf.template /etc/nginx/templates/default.conf.template
COPY deploy/nginx/security-headers.conf /etc/nginx/snippets/security-headers.conf
COPY --from=build /repo/apps/web/dist /usr/share/nginx/html
ARG VERSION=0.0.0-dev
LABEL org.opencontainers.image.version=${VERSION}
ENV API_UPSTREAM=api:8080
EXPOSE 80