Skip to content

Commit 0964217

Browse files
committed
feat: add docker entrypoint script
1 parent b14eec2 commit 0964217

File tree

4 files changed

+53
-15
lines changed

4 files changed

+53
-15
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ WORKDIR /app
55
# Copy project files
66
COPY . /app/
77

8+
# Make entrypoint script executable
9+
RUN chmod +x entrypoint.sh
10+
811
# Install dependencies
912
RUN pip install --no-cache-dir -e .
1013

@@ -15,4 +18,4 @@ RUN mkdir -p /config
1518
ENV CONFIG_PATH=/config/config.yaml
1619

1720
# Set entrypoint
18-
ENTRYPOINT ["python", "-m", "agentmesh"]
21+
CMD ["/app/entrypoint.sh"]

agentmesh/common/config/config_manager.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@
66

77
def load_config():
88
global global_config
9-
# Get config path from environment variable or use default path
10-
config_path = os.environ.get("CONFIG_PATH")
11-
12-
if not config_path:
13-
# Default path as fallback
14-
config_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../config.yaml'))
15-
16-
# Check if config file exists
17-
if not os.path.exists(config_path):
18-
raise FileNotFoundError(f"Config file not found at {config_path}")
19-
9+
# Get the absolute path to the config.yaml file
10+
config_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../config.yaml')) # Adjust the path
2011
with open(config_path, 'r') as file:
2112
# Load the YAML content into global_config
2213
global_config = yaml.safe_load(file)

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
version: '3'
1+
version: '2.0'
22

33
services:
44
agentmesh:
5-
build: .
6-
image: agentmesh
5+
image: minimalfuture/agentmesh
6+
container_name: agentmesh
77
volumes:
88
- ./config.yaml:/config/config.yaml
99
stdin_open: true # Enable interactive input

entrypoint.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
3+
echo "Welcome to AgentMesh!"
4+
echo "Available commands:"
5+
echo " list - List available teams (python main.py -l)"
6+
echo " run - Run a specific team (python main.py -t TEAM_NAME)"
7+
echo " help - Show this help message"
8+
echo " exit - Exit the container"
9+
echo ""
10+
11+
while true; do
12+
read -p "agentmesh> " cmd args
13+
14+
case "$cmd" in
15+
list)
16+
python main.py -l
17+
;;
18+
run)
19+
if [ -z "$args" ]; then
20+
echo "Error: Please specify a team name"
21+
echo "Usage: run TEAM_NAME"
22+
else
23+
python main.py -t $args
24+
fi
25+
;;
26+
help)
27+
echo "Available commands:"
28+
echo " list - List available teams"
29+
echo " run - Run a specific team (run TEAM_NAME)"
30+
echo " help - Show this help message"
31+
echo " exit - Exit the container"
32+
;;
33+
exit)
34+
echo "Goodbye!"
35+
exit 0
36+
;;
37+
*)
38+
if [ -n "$cmd" ]; then
39+
echo "Unknown command: $cmd"
40+
echo "Type 'help' for available commands"
41+
fi
42+
;;
43+
esac
44+
done

0 commit comments

Comments
 (0)