-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
35 lines (26 loc) · 1.22 KB
/
Copy pathDockerfile.dev
File metadata and controls
35 lines (26 loc) · 1.22 KB
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
# RuntimeCatch — local development image.
# Optimised for `docker compose up`, not for production: bind-mount-friendly,
# carries devDependencies (prisma, tsx) so `prisma migrate dev` and the
# seed/simulate scripts work via `docker compose exec`.
FROM node:24-bookworm-slim
# Prisma's query engine needs openssl + ca-certificates at runtime.
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# prisma.config.ts throws if DATABASE_URL is unset, and `prisma generate`
# runs in the npm `postinstall` hook. Provide a placeholder so the image
# build succeeds; compose overrides it at runtime with the real value.
ENV DATABASE_URL="postgresql://build:build@build:5432/build?schema=public"
# Install dependencies first so this layer caches across source edits.
COPY package.json package-lock.json prisma.config.ts ./
COPY prisma ./prisma
RUN npm ci
# Copy the rest of the source. `.dockerignore` keeps node_modules, .next,
# prisma/generated, and .env out of this layer.
COPY . .
ENV NODE_ENV=development
ENV PORT=3000
EXPOSE 3000
# Bind to 0.0.0.0 so the dev server is reachable from outside the container.
CMD ["npx", "next", "dev", "-H", "0.0.0.0"]