FROM node:20-alpine WORKDIR /app # Install system dependencies RUN apk add --no-cache python3 build-base g++ make # Install pnpm RUN npm install -g pnpm # Copy package files COPY package.json pnpm-lock.yaml ./ # Install dependencies RUN pnpm install --frozen-lockfile # Copy source code COPY . . # Create database directory and run migrations RUN mkdir -p db/ RUN pnpm db:generate-sqlite RUN pnpm db:migrate # Build the application RUN pnpm build # Expose the port EXPOSE 3000 # Start the application CMD ["pnpm", "start"]