diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c21ecc5e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.13-slim + +ENV PATH="${PATH}:/root/.local/bin" + +WORKDIR /ai-hedge-fund + +COPY . . + +RUN apt update && apt install -y build-essential \ + && rm -rf /var/lib/apt/lists/* \ + && pip install poetry \ + && poetry install + +ENTRYPOINT ["poetry", "run", "python", "-u", "src/main.py"] + +CMD ["--ticker", "AAPL"] diff --git a/README.md b/README.md index afd01276..97e8f176 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,30 @@ ai-hedge-fund/ ├── ... ``` +## Docker & docker-compose + +If you have docker installed on your system, you can easily run the project by running docker-compose. + +First: + +`cp .env.example .env` + +Then: + +`docker build -t ai-hedge-fund .` + +To run it directly with docker run: + +`docker run -it ai-hedge-fund` + +Or if you prefer docker-compose & docker exec: + +`docker-compose up -d` + +Finally: + +`docker exec -it ai-hedge-fund poetry run python src/main.py --ticker AAPL` + ## Contributing 1. Fork the repository diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..688467ef --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ + +services: + ai-hedge-fund: + container_name: ai-hedge-fund + restart: always + build: + context: . + dockerfile: Dockerfile + volumes: + - ./:/ai-hedge-fund + env_file: + - .env + stdin_open: true + tty: true + \ No newline at end of file