added docker file
This commit is contained in:
parent
8c5fe4266f
commit
a94f4df283
17 changed files with 931 additions and 9 deletions
29
assignment-db-service/DockerfileDEV
Normal file
29
assignment-db-service/DockerfileDEV
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# 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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue