-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 814 Bytes
/
Dockerfile
File metadata and controls
30 lines (24 loc) · 814 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
FROM oven/bun:1.3-slim AS base
FROM base AS dual
WORKDIR /temp
RUN apt-get -y update; apt-get -y install curl
# we need to use node and bun for generating prisma files, see https://github.com/prisma/prisma/issues/21241
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash
RUN apt-get install -y nodejs
FROM dual AS runner
WORKDIR /run
COPY package.json bun.lock tsconfig.json ./
RUN bun install --frozen-lockfile
ARG VERSION
ENV PUBLIC_VERSION=$VERSION
ARG SHA
ENV PUBLIC_SHA=$SHA
COPY . .
RUN bunx prisma generate
# Increase Node.js heap size for build (default is too small for large codebases)
ENV NODE_OPTIONS="--max-old-space-size=8192"
RUN bun run build:app && bun run check
USER bun
ENV NODE_ENV=production
EXPOSE 3000/tcp
CMD ["sh", "-c", "bunx prisma migrate deploy && bun ./build/index.js"]