Skip to content

Commit b14eec2

Browse files
committed
feat: add docker files
1 parent ea4b630 commit b14eec2

File tree

5 files changed

+83
-4
lines changed

5 files changed

+83
-4
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v2
18+
19+
- name: Login to DockerHub
20+
uses: docker/login-action@v2
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
- name: Extract metadata for Docker
26+
id: meta
27+
uses: docker/metadata-action@v4
28+
with:
29+
images: minimalfuture/agentmesh
30+
tags: |
31+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' }}
32+
type=sha,format=short
33+
34+
- name: Build and push Docker image
35+
uses: docker/build-push-action@v4
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}
41+
cache-from: type=gha
42+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Copy project files
6+
COPY . /app/
7+
8+
# Install dependencies
9+
RUN pip install --no-cache-dir -e .
10+
11+
# Create configuration directory
12+
RUN mkdir -p /config
13+
14+
# Set environment variable pointing to config file
15+
ENV CONFIG_PATH=/config/config.yaml
16+
17+
# Set entrypoint
18+
ENTRYPOINT ["python", "-m", "agentmesh"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Install core dependencies:
3434
pip install -r requirements.txt
3535
```
3636

37-
For browser tools, install additional dependencies (optional, python3.11+ required):
37+
For browser tools, install additional dependencies (python3.11+ required):
3838

3939
```bash
4040
pip install browser-use

agentmesh/common/config/config_manager.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@
66

77
def load_config():
88
global global_config
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
11-
with open(config_path, 'r') as file:
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+
20+
with open(config_path, 'r') as file:
1221
# Load the YAML content into global_config
1322
global_config = yaml.safe_load(file)
1423

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3'
2+
3+
services:
4+
agentmesh:
5+
build: .
6+
image: agentmesh
7+
volumes:
8+
- ./config.yaml:/config/config.yaml
9+
stdin_open: true # Enable interactive input
10+
tty: true # Allocate a pseudo-TTY

0 commit comments

Comments
 (0)