-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (25 loc) · 699 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (25 loc) · 699 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
FROM node:22-alpine AS builder
WORKDIR /app
# Enable corepack for yarn
RUN corepack enable
# Install build dependencies for better-sqlite3
RUN apk add --no-cache python3 make g++
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/ ./.yarn/
RUN yarn install --immutable
COPY . .
RUN yarn build
FROM node:22-alpine AS runner
WORKDIR /app
RUN apk add --no-cache python3 make g++
RUN corepack enable
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/ ./.yarn/
RUN yarn install --immutable --production
COPY --from=builder /app/build ./build
# Create a volume for sqlite database
VOLUME /app/_munbun_
EXPOSE 3000
ENV PORT=3000
ENV NODE_ENV=production
CMD ["node", "build/index.js"]