Migrate the web runner stage from the official nginx alpine image to a standard alpine image with the nginx package installed. This ensures the presence of the `http_sub_module` required for path rewriting in the telemetry proxy configuration. - Replace `nginx:1.27-alpine` with `alpine:3.20` and `apk add nginx` - Update Nginx configuration file path to `/etc/nginx/http.d/default.conf` - Update web asset root directory to `/var/lib/nginx/html` - Add `X-Forwarded-For` and `X-Forwarded-Proto` headers to proxy locations
29 lines
1005 B
Docker
29 lines
1005 B
Docker
FROM oven/bun:1.3.14 AS builder
|
|
WORKDIR /app
|
|
|
|
COPY package.json bun.lock bunfig.toml tsconfig.base.json ./
|
|
COPY packages/shared/package.json packages/shared/package.json
|
|
COPY apps/web/package.json apps/web/package.json
|
|
COPY apps/api/package.json apps/api/package.json
|
|
RUN bun install --frozen-lockfile
|
|
|
|
COPY packages/shared packages/shared
|
|
COPY apps/web apps/web
|
|
ARG VITE_API_BASE_URL
|
|
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
|
RUN bun run --cwd packages/shared build
|
|
RUN bun run --cwd apps/web build
|
|
|
|
# =============================================================================
|
|
# Stage 2: nginx (Alpine package — includes sub_filter module)
|
|
# Alpine's nginx package is built with --with-http_sub_module
|
|
# =============================================================================
|
|
FROM alpine:3.20 AS runner
|
|
RUN apk add --no-cache nginx
|
|
|
|
COPY apps/web/nginx.conf /etc/nginx/http.d/default.conf
|
|
COPY --from=builder /app/apps/web/dist /var/lib/nginx/html
|
|
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|