Andrei Sferdian commited on
Commit
fcf07d3
·
1 Parent(s): d1aaa5c

Add docker container support

Browse files
Files changed (8) hide show
  1. .env +0 -0
  2. .vscode/launch.json +20 -0
  3. .vscode/settings.json +1 -0
  4. .vscode/tasks.json +17 -0
  5. Dockerfile +14 -0
  6. Makefile +4 -0
  7. agent.py +1 -1
  8. docker-compose.yml +11 -0
.env ADDED
File without changes
.vscode/launch.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Debug: Python (Docker)",
6
+ "type": "debugpy",
7
+ "request": "attach",
8
+ "connect": {
9
+ "host": "localhost",
10
+ "port": 5678
11
+ },
12
+ "pathMappings": [
13
+ {
14
+ "localRoot": "${workspaceFolder}",
15
+ "remoteRoot": "/app"
16
+ }
17
+ ],
18
+ }
19
+ ]
20
+ }
.vscode/settings.json CHANGED
@@ -10,4 +10,5 @@
10
  "python.analysis.autoImportCompletions": true,
11
  "python.analysis.userFileIndexingLimit": -1,
12
  "python.analysis.indexing": true,
 
13
  }
 
10
  "python.analysis.autoImportCompletions": true,
11
  "python.analysis.userFileIndexingLimit": -1,
12
  "python.analysis.indexing": true,
13
+ "makefile.configureOnOpen": false,
14
  }
.vscode/tasks.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "Run Docker Container",
6
+ "type": "shell",
7
+ "command": "docker build -t agents-course-app . && docker run -d -p 7860:7860 -p 5678:5678 --name agents-course-debug agents-course-app",
8
+ "problemMatcher": []
9
+ },
10
+ {
11
+ "label": "Stop Docker Container",
12
+ "type": "shell",
13
+ "command": "docker stop agents-course-debug && docker rm agents-course-debug",
14
+ "problemMatcher": []
15
+ }
16
+ ]
17
+ }
Dockerfile ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN python -m venv /opt/venv && \
6
+ . /opt/venv/bin/activate
7
+
8
+ COPY requirements.txt .
9
+
10
+ RUN pip install --no-cache-dir -r requirements.txt
11
+
12
+ COPY . .
13
+
14
+ CMD ["python", "app.py"]
Makefile ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ up:
2
+ docker compose up --build
3
+ down:
4
+ docker compose down
agent.py CHANGED
@@ -18,7 +18,7 @@ class AgentState(TypedDict):
18
  messages: Annotated[list[AnyMessage], add_messages]
19
 
20
 
21
- graph = StateGraph(AgentState) # noqa: F821
22
  graph.add_node(
23
  "agent",
24
  )
 
18
  messages: Annotated[list[AnyMessage], add_messages]
19
 
20
 
21
+ graph = StateGraph(AgentState)
22
  graph.add_node(
23
  "agent",
24
  )
docker-compose.yml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ app:
3
+ build:
4
+ context: .
5
+ dockerfile: Dockerfile
6
+ ports:
7
+ - "7860:7860"
8
+ - "5678:5678"
9
+ container_name: agents-course-app
10
+ env_file:
11
+ - .env