aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 47f5a776bf6b8764cc9904fe4bb128fac37a0594 (plain) (blame)
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
FROM oven/bun:1.0.1 as build

WORKDIR /due

RUN apt update -y && apt upgrade -y
RUN apt install sqlite3 -y

COPY package.json ./

RUN bun install

COPY src/ ./src
COPY static/ ./static
COPY bun.lockb due_moe_schema.sql svelte.config.js tsconfig.json vite.config.ts ./

RUN mkdir data
RUN sqlite3 data/due_moe.sqlite3 < due_moe_schema.sql
RUN bun --bun vite build

FROM oven/bun:1.0.1

WORKDIR /due

COPY --from=build /due/build ./build
COPY --from=build /due/data  ./data

EXPOSE 3000

CMD ["bun", "./build/index.js"]