Files
digicraft-be/Dockerfile
Fahri Can Seçer 80dcf4d04a
Some checks failed
Deploy Backend / deploy (push) Has been cancelled
main
2026-02-05 01:29:22 +03:00

37 lines
720 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 ["npx", "tsx", "index.ts"]