feature(Integrate FE,BE into 1 docker file):

This commit is contained in:
Devoalda 2023-10-30 12:50:50 +08:00
parent 33b74987ab
commit 2ac61c8f38
1 changed files with 3 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# REact Frontend # React Frontend
FROM node as react-build FROM node as react-build
WORKDIR /frontend WORKDIR /frontend
@ -6,7 +6,8 @@ COPY safeshare-frontend/ ./
RUN npm install RUN npm install
RUN npm run build # Start the react app
CMD ["npm", "start"]
FROM python:3.10 as backend-build FROM python:3.10 as backend-build
@ -21,13 +22,4 @@ COPY . /code/
RUN chmod a+x start.sh RUN chmod a+x start.sh
# FInal Image
FROM python:3.10
WORKDIR /code
COPY --from=react-build /frontend/build/ /code/safeshare-frontend/
COPY --from=backend-build /code/ /code/
EXPOSE 3000
EXPOSE 8000
CMD ["./start.sh"] CMD ["./start.sh"]