26 lines
528 B
Docker
26 lines
528 B
Docker
# Build frontend
|
|
FROM node:24-alpine AS frontend
|
|
WORKDIR /app/frontend
|
|
COPY frontend/package*.json ./
|
|
RUN npm install
|
|
COPY frontend ./
|
|
RUN npm run build
|
|
|
|
# Build backend
|
|
FROM node:24-alpine AS backend
|
|
WORKDIR /app
|
|
COPY backend/package*.json ./backend/
|
|
COPY backend/ ./backend/
|
|
RUN cd backend && npm install
|
|
|
|
RUN mkdir -p /data/uploads && chmod -R 777 /data
|
|
|
|
# Copy built frontend into backend
|
|
COPY --from=frontend /app/frontend/dist ./frontend/dist
|
|
|
|
WORKDIR /app/backend
|
|
EXPOSE 3000
|
|
|
|
ENV DATA_DIR=/data
|
|
|
|
CMD ["node", "index.js"] |