2026-03-21 21:48:56 -05:00
|
|
|
FROM node:20-alpine
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-03-21 22:32:25 -05:00
|
|
|
# Install build tools + OpenSSL (required by Prisma query engine on Alpine)
|
|
|
|
|
RUN apk add --no-cache python3 make g++ openssl openssl-dev
|
2026-03-21 21:48:56 -05:00
|
|
|
|
|
|
|
|
# Copy package manifests
|
|
|
|
|
COPY package*.json ./
|
|
|
|
|
COPY client/package*.json ./client/
|
|
|
|
|
|
|
|
|
|
# Install all dependencies (dev deps needed for prisma CLI + tsc build)
|
|
|
|
|
RUN npm install
|
|
|
|
|
RUN cd client && npm install
|
|
|
|
|
|
|
|
|
|
# Copy source
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Generate Prisma client for target platform (must happen before tsc)
|
|
|
|
|
RUN npx prisma generate
|
|
|
|
|
|
|
|
|
|
# Build server (tsc) + client (vite)
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
# Ensure data directory exists for SQLite bind mount
|
|
|
|
|
RUN mkdir -p /app/data
|
|
|
|
|
|
2026-03-21 22:52:16 -05:00
|
|
|
# Copy and make entrypoint executable
|
|
|
|
|
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
|
|
|
|
RUN chmod +x /app/docker-entrypoint.sh
|
|
|
|
|
|
2026-03-21 21:48:56 -05:00
|
|
|
EXPOSE 3001
|
|
|
|
|
|
2026-03-21 22:52:16 -05:00
|
|
|
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|