-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.31 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (34 loc) · 1.31 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
# Use an official Node.js 20 image as the base (matches CI)
FROM node:20-bullseye
# Install Python and pip (used by the PDF generators)
RUN apt-get update && apt-get install -y python3 python3-pip && \
rm -rf /var/lib/apt/lists/*
# Create and set the working directory
WORKDIR /app
# Copy manifests first for efficient caching.
# .npmrc carries `legacy-peer-deps=true` and MUST be present before `npm install`
# (Better-Auth declares optional framework peers that otherwise conflict).
COPY package*.json .npmrc ./
COPY requirements.txt ./
# Install Node.js dependencies
RUN npm install
# Install Python dependencies
RUN pip3 install -r requirements.txt
# Copy the rest of the repository
COPY . .
# Generate the Prisma client against the real schema. `npm install` ran before
# the schema was present, so @prisma/client only has a throwing stub until now.
RUN npx prisma generate
# Set environment to production
ENV NODE_ENV=production
# Self-hosted file storage (replaces Firebase Storage). Mount a persistent
# Podman/Docker volume here so uploaded receipts survive redeploys.
ENV STORAGE_DIR=/app/storage
RUN mkdir -p /app/storage
VOLUME ["/app/storage"]
# Build the Next.js application
RUN npm run build
# The app listens on 3100 (see `next start -p 3100`)
EXPOSE 3100
# Start the Next.js server
CMD ["npm", "run", "start"]