Spaces:
Sleeping

protofolio / Dockerfile
moustafa7's picture
Fix: Use persistent /data/uploads directory for Hugging Face
70b46f4
Raw History Blame Contribute Delete
596 Bytes
FROM node:20-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ ./
RUN npm run build
FROM node:20-bullseye
RUN apt-get update -y && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY backend/package*.json ./
RUN npm install
COPY backend/ ./
RUN npx prisma generate
RUN npm run build
COPY --from=frontend-build /app/frontend/dist ./public
RUN mkdir -p /data/uploads
EXPOSE 7860
ENV UPLOAD_DIR=/data/uploads
CMD ["sh", "-c", "npx prisma db push --accept-data-loss && npx prisma db seed && node dist/app.js"]