From acf32966f701c831a9b039683df32f9ea850cc9f Mon Sep 17 00:00:00 2001 From: Patrick Daly Date: Fri, 23 Jul 2021 09:08:41 -0700 Subject: [PATCH] updating docker to use poetry --- Dockerfile | 18 ++++++++++++++---- pyproject.toml | 3 +++ scripts/dev_tools.py | 9 +++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index df98198..a104e94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,20 @@ FROM python:3.9 -COPY ./requirements.txt /app/requirements.txt -RUN pip install -r /app/requirements.txt +RUN pip install -U pip \ + && apt-get update \ + && curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - + +ENV PATH="${PATH}:/root/.poetry/bin" COPY . /app WORKDIR /app/ -ENTRYPOINT ["./run.sh"] -CMD [] +RUN poetry install + +# easy bruh... +#ENTRYPOINT ["./run.sh"] + +# easter eggs 😝 +RUN echo "PS1='🐳:\[\033[1;36m\]\h \[\033[1;34m\]\W\[\033[0;35m\]\[\033[1;36m\]$ \[\033[0m\]'" >> ~/.bashrc + +CMD /bin/bash diff --git a/pyproject.toml b/pyproject.toml index b5645e4..13ac3a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,9 @@ isortcheck = 'scripts.dev_tools:isortcheck' mypy = 'scripts.dev_tools:mypy' black = 'scripts.dev_tools:black' blackcheck = 'scripts.dev_tools:blackcheck' +start = 'scripts.dev_tools:start' +start_it = 'scripts.dev_tools:start_it' +build = 'scripts.dev_tools:build' [tool.black] exclude = ''' diff --git a/scripts/dev_tools.py b/scripts/dev_tools.py index 5e311b0..f92e8bd 100644 --- a/scripts/dev_tools.py +++ b/scripts/dev_tools.py @@ -20,3 +20,12 @@ def black(): def blackcheck(): check_call(['black', '--diff', '--color', '.']) + +def start(): + check_call(['docker', 'run', 'mev-inspect']) + +def build(): + check_call(['docker', 'build', '-t', 'mev-inspect', '.']) + +def start_it(): + check_call(['docker', 'run', '-it', 'mev-inspect'])