2025-04-28 09:53:22 -07:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
|
|
|
|
|
# Use the official Node.js image as the base image
|
|
|
|
|
ARG NODE_VERSION=22.13.1
|
|
|
|
|
FROM node:${NODE_VERSION}-slim AS base
|
|
|
|
|
|
|
|
|
|
# Set the working directory
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Then copy the rest of the application code
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Install build tools (needed for bcrypt native bindings)
|
|
|
|
|
RUN apt-get update -y && apt-get install -y build-essential python3 openssl
|
|
|
|
|
|
|
|
|
|
# Copy only package files first (faster caching)
|
|
|
|
|
COPY package*.json ./
|
|
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
|
RUN npm install && npx prisma generate
|
|
|
|
|
|
|
|
|
|
# Rebuild bcrypt specifically (optional if clean install is guaranteed)
|
2025-04-29 12:01:10 -07:00
|
|
|
# RUN npm rebuild bcrypt --build-from-source
|
2025-04-28 09:53:22 -07:00
|
|
|
|
|
|
|
|
# Expose the application port
|
|
|
|
|
EXPOSE 3200
|
|
|
|
|
|
|
|
|
|
# Start the application
|
|
|
|
|
CMD ["node", "app.js"]
|