-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
53 lines (28 loc) · 859 Bytes
/
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
##### BUILDER
FROM node:19-alpine AS builder
RUN apk add --update --no-cache python3 make g++
RUN ln -sf python3 /usr/bin/python
WORKDIR /app
COPY package.json pnpm-lock.yaml\* ./
RUN yarn global add pnpm
RUN pnpm i;
COPY . .
ENV DATABASE_FILE ./dev.db
RUN pnpm build
##### RUNNER
FROM --platform=linux/amd64 node:19-alpine AS runner
WORKDIR /app
RUN apk add --update --no-cache python3 make g++
RUN ln -sf python3 /usr/bin/python
ENV DATABASE_FILE ./dev.db
ENV NODE_ENV production
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/build ./build
COPY package.json pnpm-lock.yaml\* ./
COPY dockerEntrypoint.sh ./dockerEntrypoint.sh
COPY src/lib/server/db/migrations ./src/lib/server/db/migrations
EXPOSE 3000
ENV PORT 3000
RUN chmod +x /app/dockerEntrypoint.sh
ENTRYPOINT ["/app/dockerEntrypoint.sh"]
CMD []