added multiple script modifications and finalized the dockerfile

This commit is contained in:
2023-12-26 22:42:52 +02:00
parent de1c0750df
commit df961f50c6
8 changed files with 37 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
FROM python:3.11-buster as builder
FROM python:3.11-buster
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 -
@@ -10,19 +10,14 @@ ENV POETRY_NO_INTERACTION=1 \
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN touch README.md
COPY pyproject.toml poetry.lock /app/
COPY market_trade /app/market_trade/
COPY tools /app/tools
RUN mkdir --parents --mode 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN --mount=type=ssh --mount=type=cache,target=$POETRY_CACHE_DIR $HOME/.local/bin/poetry install --without dev --no-root
FROM python:3.11-slim-buster as runtime
RUN --mount=type=ssh --mount=type=cache,target=$POETRY_CACHE_DIR $HOME/.local/bin/poetry install --without dev
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY market_trade ./market_trade
ENTRYPOINT ["python", "-m", "annapurna.main"]
ENTRYPOINT ["python", "tools/save_currencies_data.py"]