Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Added dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
beeb committed May 28, 2021
1 parent a0244af commit cd9af7c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
*

!pancaketrade/*.py
!pancaketrade/conversations/*.py
!pancaketrade/network/*.py
!pancaketrade/persistence/*.py
!pancaketrade/utils/*.py
!pancaketrade/watchers/*.py
!pancaketrade/abi
!poetry.lock
!poetry.toml
!pyproject.toml
!schema.yml
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM python:3.9-buster AS build-deps

WORKDIR /app

ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
# poetry will be installed here
POETRY_HOME="/opt/poetry" \
POETRY_NO_INTERACTION=1 \
POETRY_NO_ANSI=1
# add poetry to path
ENV PATH="$POETRY_HOME/bin:$PATH"

# install poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -

COPY . ./
RUN poetry install --no-dev

FROM python:3.9-slim-buster

WORKDIR /app
# the user needs to be able to write the database file to /app
RUN chown 1000:1000 /app

ENV PYTHONUNBUFFERED=1 \
VENV_PATH="/app/.venv"
# add virtual environment binaries to path
ENV PATH="$VENV_PATH/bin:$PATH"

COPY --from=build-deps /app .

USER 1000

ENTRYPOINT [ "trade" ]
CMD [ "config.yml" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the mechanism of this bot.

## Features

The bot provides a lot of convenience trading featuers including:
The bot provides a lot of convenience trading features including:

- Tokens balance and price shown in status messages
- Ability to make buy and sell limit orders including trailing stop loss
Expand Down

0 comments on commit cd9af7c

Please sign in to comment.