Skip to content

Commit

Permalink
feat: Dockerfile and Makefile added
Browse files Browse the repository at this point in the history
  • Loading branch information
platonfloria committed May 28, 2024
1 parent df79d3f commit e7fd7d9
Show file tree
Hide file tree
Showing 4 changed files with 647 additions and 589 deletions.
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# syntax=docker/dockerfile:experimental
# -- Base Image --
# Installs application dependencies
FROM python:3.11.9 as base

ARG VERSION

ENV PYTHONUNBUFFERED 1
ENV VERSION=$VERSION

RUN apt update
RUN apt install -y libopenblas-dev
RUN pip install poetry \
&& poetry config virtualenvs.create false
# Set up application environment
WORKDIR /app
COPY ./pyproject.toml ./poetry.lock ./README.md ./
RUN mkdir ./fastlane_bot && touch ./fastlane_bot/__init__.py
RUN poetry install --only main --no-interaction

# -- Test Image --
# Code to be mounted into /app
FROM base as test
RUN poetry install --no-interaction
COPY ./.env ./main.py ./run_blockchain_terraformer.py ./run_tests ./
COPY ./fastlane_bot ./fastlane_bot
COPY ./resources/NBTest ./resources/NBTest
ENTRYPOINT ["./run_tests"]

# -- Production Image --
# Runs the service
FROM base as prod
COPY ./.env ./main.py ./run_blockchain_terraformer.py ./
COPY ./fastlane_bot ./fastlane_bot
ENTRYPOINT ["python", "main.py"]
31 changes: 31 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
docker_build:
docker build --tag fastlane-bot --target prod .

docker_run:
docker run \
fastlane-bot \
--arb_mode=b3_two_hop \
--alchemy_max_block_fetch=20 \
--loglevel=INFO \
--backdate_pools=False \
--polling_interval=0 \
--reorg_delay=0 \
--run_data_validator=False \
--limit_bancor3_flashloan_tokens=True \
--randomizer=2 \
--default_min_profit_gas_token=0.001 \
--exchanges="carbon_v1,bancor_v3,balancer,uniswap_v2_forks,uniswap_v3_forks" \
--flashloan_tokens="0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" \
--blockchain=ethereum \
--self_fund=False \
--read_only=True

docker_test:
docker build --tag fastlane-bot-tests --target test .
docker run fastlane-bot-tests

docker_debug:
docker run \
-it \
--entrypoint bash \
fastlane-bot \
Loading

0 comments on commit e7fd7d9

Please sign in to comment.