-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (28 loc) · 923 Bytes
/
Dockerfile
File metadata and controls
36 lines (28 loc) · 923 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
FROM oven/bun:1-alpine AS base
WORKDIR /app
# Install build dependencies and runtime libraries for Sharp
RUN apk add --no-cache python3 py3-setuptools make g++ vips-dev vips
FROM base AS deps
COPY package.json bun.lock .npmrc ./
RUN bun install --frozen-lockfile
FROM base AS prod-deps
COPY package.json bun.lock .npmrc ./
RUN bun install --frozen-lockfile --production && \
rm -rf /root/.bun/install/cache
FROM deps AS build
COPY . .
RUN bun run build
FROM oven/bun:1-alpine AS runtime
WORKDIR /app
# Install only runtime dependencies for Sharp (vips, not vips-dev)
RUN apk add --no-cache vips
# Copy production dependencies
COPY --from=prod-deps /app/node_modules ./node_modules
# Copy built application
COPY --from=build /app/dist ./dist
# Copy package.json for any runtime requirements
COPY --from=build /app/package.json ./
ENV HOST=0.0.0.0
ENV PORT=8080
EXPOSE 8080
CMD ["bun", "./dist/server/entry.mjs"]