28 lines
785 B
Docker
28 lines
785 B
Docker
|
|
# syntax=docker/dockerfile:1.6
|
||
|
|
|
||
|
|
# ─── Stage 1 : build avec Bun ─────────────────────────────────
|
||
|
|
FROM oven/bun:1.3-alpine AS builder
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Deps avec cache
|
||
|
|
COPY package.json bun.lock ./
|
||
|
|
RUN bun install --frozen-lockfile
|
||
|
|
|
||
|
|
# Source + build statique
|
||
|
|
COPY . .
|
||
|
|
RUN bun run build
|
||
|
|
|
||
|
|
# ─── Stage 2 : serve avec nginx ──────────────────────────────
|
||
|
|
FROM nginx:1.27-alpine
|
||
|
|
WORKDIR /usr/share/nginx/html
|
||
|
|
|
||
|
|
# Conf nginx minimale (cache, mime, gzip, sécurité de base)
|
||
|
|
RUN rm -f /etc/nginx/conf.d/default.conf
|
||
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||
|
|
|
||
|
|
# Static assets
|
||
|
|
COPY --from=builder /app/dist .
|
||
|
|
|
||
|
|
EXPOSE 80
|
||
|
|
CMD ["nginx", "-g", "daemon off;"]
|