Skip to content

Commit d14772c

Browse files
committed
Update Docker setup to use Docker Compose for easier command execution
1 parent b2e91de commit d14772c

File tree

2 files changed

+40
-18
lines changed

2 files changed

+40
-18
lines changed

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,31 +111,23 @@ poetry run python src/backtester.py --ticker AAPL --start-date 2024-01-01 --end-
111111

112112
## Docker
113113

114-
You can also build and run the project using Docker.
114+
You can run the project easily using Docker Compose.
115115

116-
1. Build the Docker image:
116+
1. Run the agent with custom parameters:
117117
```bash
118-
docker build -t ai-hedge-fund .
118+
docker compose run agent --ticker AAPL
119119
```
120120

121-
2. Run the Hedge Fund system:
121+
2. Run the backtester with custom parameters:
122122
```bash
123-
docker run -it --env-file .env ai-hedge-fund python src/agents.py --ticker AAPL
123+
docker compose run backtester --ticker AAPL
124124
```
125125

126-
3. Run the Backtester:
127-
```bash
128-
docker run -it --env-file .env ai-hedge-fund python src/backtester.py --ticker AAPL
129-
```
130-
131-
4. Run with additional options (e.g., reasoning and date range):
132-
```bash
133-
docker run -it --env-file .env ai-hedge-fund python src/agents.py \
134-
--ticker AAPL \
135-
--start-date 2024-01-01 \
136-
--end-date 2024-03-01 \
137-
--show-reasoning
138-
```
126+
Note:
127+
- The `.env` file will be automatically loaded by Docker Compose
128+
- Use `docker-compose up` to run with default parameters defined in docker-compose.yml
129+
- Use `docker-compose run` to pass custom parameters - no need to specify the python command
130+
- All arguments after the service name are passed directly to the script
139131

140132
## Project Structure
141133
```

docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '3.8'
2+
3+
services:
4+
agent:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
env_file: .env
9+
volumes:
10+
- .:/app
11+
entrypoint: python src/agents.py
12+
command: --ticker AAPL
13+
networks:
14+
- ai-hedge-fund
15+
16+
backtester:
17+
build:
18+
context: .
19+
dockerfile: Dockerfile
20+
env_file: .env
21+
volumes:
22+
- .:/app
23+
entrypoint: python src/backtester.py
24+
command: --ticker AAPL
25+
networks:
26+
- ai-hedge-fund
27+
28+
networks:
29+
ai-hedge-fund:
30+
driver: bridge

0 commit comments

Comments
 (0)