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

This commit is contained in:
Devoalda 2023-10-30 12:38:10 +08:00
parent 8914c6b356
commit 33b74987ab
1 changed files with 33 additions and 0 deletions

33
safeshare/DockerfileFEBE Normal file
View File

@ -0,0 +1,33 @@
# REact Frontend
FROM node as react-build
WORKDIR /frontend
COPY safeshare-frontend/ ./
RUN npm install
RUN npm run build
FROM python:3.10 as backend-build
ENV PYTHONUNBUFFERED 1
WORKDIR /code
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . /code/
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"]