-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
47 lines (34 loc) · 1013 Bytes
/
dockerfile
File metadata and controls
47 lines (34 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# ================================
# 1. Base & dépendances (prod)
# ================================
FROM oven/bun:1 AS deps
WORKDIR /app
COPY bun.lockb package.json ./
RUN --mount=type=cache,target=/root/.bun \
bun install --frozen-lockfile --production
# ================================
# 2. Build (TypeScript → dist/)
# ================================
FROM oven/bun:1 AS build
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules node_modules
ENV NODE_ENV=production
RUN bun run build
# ================================
# 3. Image finale (release)
# ================================
FROM oven/bun:slim AS release
WORKDIR /app
# Dépendances prod uniquement
COPY --from=deps /app/node_modules node_modules
# Code compilé
COPY --from=build /app/dist dist
COPY package.json .
# Sécurité
USER bun
EXPOSE 5000
# Healthcheck (optionnel, si tu as /health)
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost:5000/health || exit 1
CMD ["bun", "run", "dist/server.js"]