FROM node:24-alpine

# Install native build tools for bcrypt/better-sqlite3 + git for npm git-URL deps
RUN apk add --no-cache python3 make g++ git

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY tsconfig.json ./
COPY src ./src
COPY public ./public

RUN mkdir -p /app/data/uploads

EXPOSE 3000

CMD ["node", "--import", "tsx", "src/index.ts"]
