Python with Flask

This commit is contained in:
2021-07-14 10:11:54 -04:00
parent 7a6e9dec95
commit 4a321b4105
11 changed files with 56 additions and 70 deletions

View File

@ -1,37 +1,13 @@
FROM continuumio/miniconda3 as build
FROM python:3.9 as runtime
WORKDIR /app/
COPY ./python/ /app/src/
COPY ./python/ /app/
RUN conda env create -f ./src/environment.yml
RUN python -m pip install gunicorn httpx flask
#RUN echo "conda activate cryptos" >> ~/.bashrc
#SHELL ["/bin/bash", "--login", "-c"]
EXPOSE 5001
RUN conda install -c conda-forge conda-pack
CMD ["gunicorn", "-b", "0.0.0.0:5001", "crypto.index:app"]
RUN conda pack -n cryptos -o /tmp/env.tar && \
mkdir /venv/ && cd /venv/ && tar xf /tmp/env.tar && \
rm /tmp/env.tar
RUN /venv/bin/conda-unpack
FROM python:buster as runtime
WORKDIR /app/
COPY ./python/ /app/src/
COPY ./automation/bin/ /app/bin/
COPY --from=build /venv/ /venv/
SHELL ["/bin/bash", "-c"]
RUN pip install pyinstaller
RUN pyinstaller -F -n coingecko --clean --log-level DEBUG --distpath /app/bin/ /app/src/coingecko.py && \
pyinstaller -F -n mindicador --clean --log-level DEBUG --distpath /app/bin/ /app/src/miindicador.py
ENTRYPOINT [ "/bin/bash" ]
#ENTRYPOINT [ "/bin/bash" ]