|
|
|
FROM node:18 AS build |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY frontend/package.json frontend/package-lock.json ./frontend/ |
|
|
|
|
|
RUN cd frontend && npm install |
|
|
|
|
|
COPY frontend ./frontend |
|
|
|
|
|
RUN cd frontend && npm run build |
|
|
|
|
|
FROM node:18 |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY backend/package.json backend/package-lock.json ./backend/ |
|
RUN cd backend && npm install |
|
|
|
|
|
COPY --from=build /app/frontend/dist ./backend/build |
|
|
|
|
|
COPY backend ./backend |
|
|
|
|
|
RUN mkdir -p /app/backend/database && chmod -R 777 /app/backend/database \ |
|
&& touch /app/backend/server.log && chmod 777 /app/backend/server.log |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
WORKDIR /app/backend |
|
|
|
|
|
CMD [ "node", "./index.js" ] |