tested dockerfile
This commit is contained in:
28
dockerfiles/Dockerfile
Normal file
28
dockerfiles/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
FROM python:3.11-buster as builder
|
||||
|
||||
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.1 python3 -
|
||||
|
||||
|
||||
ENV POETRY_NO_INTERACTION=1 \
|
||||
POETRY_VIRTUALENVS_IN_PROJECT=1 \
|
||||
POETRY_VIRTUALENVS_CREATE=1 \
|
||||
POETRY_CACHE_DIR=/tmp/poetry_cache
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
RUN touch README.md
|
||||
|
||||
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
|
||||
|
||||
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"]
|
||||
Reference in New Issue
Block a user