-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
55 lines (37 loc) · 1.01 KB
/
Dockerfile
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
48
49
50
51
52
53
54
55
FROM debian:12-slim as base
WORKDIR /app
ENV PATH="${PATH}:/root/.bun/bin"
RUN apt update
RUN apt install curl unzip patch -y
RUN curl -fsSL https://bun.sh/install | bash
RUN bun -v
# ? -------------------------
FROM base as deps-prod
WORKDIR /app
COPY . .
RUN bun i --production
# ? -------------------------
FROM base as builder
WORKDIR /app
COPY . .
RUN bun i
RUN cd web && bun --bun run vite build
RUN cd web && bun ./tools/patchSW.ts
# ? -------------------------
FROM gcr.io/distroless/cc-debian12
WORKDIR /app
ENV HOST 0.0.0.0
ENV PORT 8080
ENV NODE_ENV production
# https://github.com/gornostay25/svelte-adapter-bun/issues/39
ENV PROTOCOL_HEADER x-forwarded-proto
ENV HOST_HEADER x-forwarded-host
EXPOSE 8080
COPY package.json ./
COPY --from=base /root/.bun/bin/bun bun
# COPY --from=base /opt /
COPY --from=deps-prod /app/node_modules ./build/node_modules
COPY --from=builder /app/web/build ./build
COPY --from=builder /app/web/.svelte-kit ./.svelte-kit
# COPY public public
CMD ["./bun", "./build/index.js"]