From 33b74987abc7e2fa8afe9ab3a4b0629afad07ce1 Mon Sep 17 00:00:00 2001 From: Devoalda Date: Mon, 30 Oct 2023 12:38:10 +0800 Subject: [PATCH] feature(Integrate FE,BE into 1 docker file): --- safeshare/DockerfileFEBE | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 safeshare/DockerfileFEBE diff --git a/safeshare/DockerfileFEBE b/safeshare/DockerfileFEBE new file mode 100644 index 0000000..6a58076 --- /dev/null +++ b/safeshare/DockerfileFEBE @@ -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"] \ No newline at end of file