-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 786 Bytes
/
Dockerfile
File metadata and controls
43 lines (30 loc) · 786 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
FROM oven/bun:1-alpine AS installer
RUN mkdir -p /build
WORKDIR /build
## Copy package files
COPY bun.lock /build/
COPY package.json /build/
## Install dependencies
RUN bun install --frozen-lockfile
# Source Image
FROM installer AS sources
## Copy sources
COPY src /build/src
COPY static /build/static
COPY examples /build/examples
COPY svelte.config.ts /build/
COPY vite.config.ts /build/
COPY tsconfig.json /build/
COPY server.ts /build/
# Builder Image
FROM sources AS builder
WORKDIR /build
RUN bun run build
# Final image
FROM oven/bun:1-alpine
WORKDIR /build
COPY --from=builder /build/.svelte-kit/output/server .svelte-kit/output/server
COPY --from=builder /build/node_modules node_modules
COPY --from=builder /build/server.ts .
EXPOSE 7000
CMD ["bun", "server.ts"]