2021-06-28 23:15:13 -04:00
|
|
|
FROM continuumio/miniconda3 as build
|
|
|
|
|
2021-07-07 08:56:05 -04:00
|
|
|
WORKDIR /app/
|
2021-06-28 23:15:13 -04:00
|
|
|
|
2021-07-07 08:56:05 -04:00
|
|
|
COPY ./python/ /app/src/
|
2021-06-28 23:15:13 -04:00
|
|
|
|
2021-07-07 08:56:05 -04:00
|
|
|
RUN conda env create -f ./src/environment.yml
|
2021-06-28 23:15:13 -04:00
|
|
|
|
|
|
|
#RUN echo "conda activate cryptos" >> ~/.bashrc
|
|
|
|
#SHELL ["/bin/bash", "--login", "-c"]
|
|
|
|
|
|
|
|
RUN conda install -c conda-forge conda-pack
|
|
|
|
|
|
|
|
RUN conda pack -n cryptos -o /tmp/env.tar && \
|
2021-07-07 08:56:05 -04:00
|
|
|
mkdir /venv/ && cd /venv/ && tar xf /tmp/env.tar && \
|
2021-06-28 23:15:13 -04:00
|
|
|
rm /tmp/env.tar
|
|
|
|
|
|
|
|
RUN /venv/bin/conda-unpack
|
|
|
|
|
|
|
|
|
|
|
|
FROM python:buster as runtime
|
|
|
|
|
2021-07-07 08:56:05 -04:00
|
|
|
WORKDIR /app/
|
2021-06-28 23:15:13 -04:00
|
|
|
|
2021-07-07 08:56:05 -04:00
|
|
|
COPY ./python/ /app/src/
|
|
|
|
COPY ./automation/bin/ /app/bin/
|
2021-06-28 23:15:13 -04:00
|
|
|
|
2021-07-07 08:56:05 -04:00
|
|
|
COPY --from=build /venv/ /venv/
|
2021-06-28 23:15:13 -04:00
|
|
|
|
|
|
|
SHELL ["/bin/bash", "-c"]
|
|
|
|
|
|
|
|
RUN pip install pyinstaller
|
|
|
|
|
2021-07-07 08:56:05 -04:00
|
|
|
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
|
2021-06-28 23:15:13 -04:00
|
|
|
|
|
|
|
ENTRYPOINT [ "/bin/bash" ]
|