microservices/assignment-db-service/DockerfileDEV

29 lines
718 B
Text
Raw Normal View History

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)
RUN npm rebuild bcrypt --build-from-source
# Expose the application port
EXPOSE 3200
# Start the application
CMD ["node", "app.js"]