-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
46 lines (34 loc) · 1.61 KB
/
Dockerfile.dev
File metadata and controls
46 lines (34 loc) · 1.61 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
36
37
38
39
40
41
42
43
44
45
46
# Dockerfile.dev — Development image for Mathison
#
# Used by docker-compose.local.yml for the setup, web, and worker services.
# Source code is bind-mounted at runtime for hot reloading.
# node_modules are cached in a named Docker volume.
FROM node:22-alpine
WORKDIR /app
# System dependencies required by some Node.js native modules + CLI tools
RUN apk add --no-cache libc6-compat curl bash openssl
# Install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/$(uname -m | sed 's/aarch64/arm64/' | sed 's/x86_64/amd64/')/kubectl" \
&& chmod +x kubectl \
&& mv kubectl /usr/local/bin/
# Copy dependency manifests (layer cached until these files change)
COPY package.json yarn.lock ./
# Install all dependencies (dev + prod) for development
RUN yarn install --frozen-lockfile
# Copy Prisma schema and config for client generation
COPY prisma ./prisma/
COPY prisma.config.ts tsconfig.json ./
# Generate Prisma client (needs a dummy DATABASE_URL since prisma.config.ts
# evaluates env("DATABASE_URL") — actual URL is provided at runtime)
ENV DATABASE_URL="postgresql://dummy:dummy@localhost:5432/dummy"
RUN npx prisma generate
# Clear the dummy — runtime env takes over
ENV DATABASE_URL=""
# Entrypoint rewrites kubeconfig for Docker-to-host K8s connectivity
COPY docker-entrypoint.dev.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.dev.sh
# Source code is mounted as a volume in dev mode, but copy it into the image
# so the setup service can run migrations/seed without requiring the mount
COPY . .
EXPOSE 3000
ENTRYPOINT ["docker-entrypoint.dev.sh"]