aboutsummaryrefslogtreecommitdiffstats
path: root/cargo/Dockerfile
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-05-19 19:54:35 +0000
committerterminaldweller <thabogre@gmail.com>2022-05-19 19:54:35 +0000
commitfd6f77c7ec5aad1d6fe15f42f681820d10f34b93 (patch)
tree22aec3ae1d7ff778a648cf35854bae2a25c5d27a /cargo/Dockerfile
parentpush before a new branch (diff)
downloaddevourer-fd6f77c7ec5aad1d6fe15f42f681820d10f34b93.tar.gz
devourer-fd6f77c7ec5aad1d6fe15f42f681820d10f34b93.zip
restructing. added a new service to handle the downloading
Diffstat (limited to '')
-rw-r--r--cargo/Dockerfile26
1 files changed, 26 insertions, 0 deletions
diff --git a/cargo/Dockerfile b/cargo/Dockerfile
new file mode 100644
index 0000000..87fc968
--- /dev/null
+++ b/cargo/Dockerfile
@@ -0,0 +1,26 @@
+FROM python:3.8.11-slim as python-base
+ENV PYTHONUNBUFFERED=1 \
+ PYTHONDONTWRITEBYTECODE=1 \
+ PIP_NO_CACHE_DIR=off \
+ PIP_DISABLE_PIP_VERSION_CHECK=on \
+ PIP_DEFAULT_TIMEOUT=100 \
+ POETRY_HOME="/poetry" \
+ POETRY_VIRTUALENVS_IN_PROJECT=true \
+ POETRY_NO_INTERACTION=1 \
+ PYSETUP_PATH="/cargo" \
+ VENV_PATH="/cargo/.venv"
+ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
+
+FROM python-base as builder-base
+ENV POETRY_VERSION=1.0.0
+RUN apt update && apt install -y --no-install-recommends curl build-essential
+RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
+WORKDIR $PYSETUP_PATH
+COPY ./pyproject.toml ./
+RUN poetry install --no-dev
+
+FROM python-base as production
+ENV FASTAPI_ENV=production
+COPY --from=builder-base $VENV_PATH $VENV_PATH
+COPY ./cargo.py $PYSETUP_PATH/cargo.py
+WORKDIR $PYSETUP_PATH