Files
digicraft-be/Dockerfile
Fahri Can Seçer 10bd3d3942
All checks were successful
Deploy Backend / deploy (push) Successful in 1m3s
main
2026-02-05 02:05:57 +03:00

37 lines
710 B
Docker

# Build stage
FROM node:20-slim AS builder
WORKDIR /app
# Install openssl for Prisma
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
COPY package*.json ./
COPY prisma ./prisma/
RUN npm install
RUN npx prisma generate
COPY . .
# In this specific project, we run via tsx directly
# If a build step is added later, it should happen here
# Production stage
FROM node:20-slim
WORKDIR /app
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/prisma ./prisma
COPY . .
# Ensure data directory exists for SQLite
RUN mkdir -p /app/data
EXPOSE 3001
CMD ["npm", "start"]