Skip to content

Commit 5e45ec8

Browse files
committed
feat (server-revamp): added docker container for server (WIP)
1 parent b6fa22a commit 5e45ec8

File tree

16 files changed

+324
-45
lines changed

16 files changed

+324
-45
lines changed

src/server/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# src/server/Dockerfile
2+
3+
# Use a slim Python base image for a smaller final container
4+
FROM python:3.11-slim
5+
6+
# Set environment variables for Python
7+
ENV PYTHONDONTWRITEBYTECODE 1
8+
ENV PYTHONUNBUFFERED 1
9+
10+
# Install system dependencies
11+
# - supervisor: to manage all our processes
12+
# - curl
13+
RUN apt-get update && apt-get install -y --no-install-recommends \
14+
supervisor \
15+
curl \
16+
unzip \
17+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
18+
19+
# Create necessary directories
20+
RUN mkdir -p /etc/supervisor/conf.d /var/log/supervisor
21+
22+
# Set the working directory
23+
WORKDIR /app
24+
25+
# Copy the supervisor configuration file from the build context (src/server)
26+
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
27+
28+
# Install Python dependencies. Note the path is now local to the build context.
29+
COPY requirements.txt .
30+
RUN pip install --no-cache-dir --upgrade pip && \
31+
pip install --no-cache-dir -r requirements.txt
32+
33+
# Copy all the server-side Python code from the build context (src/server) into the container
34+
COPY . .
35+
36+
# Copy the startup script and make it executable
37+
COPY start.sh .
38+
RUN chmod +x ./start.sh
39+
40+
# Expose the public port for the main FastAPI server
41+
EXPOSE 5000
42+
43+
# The command to run when the container starts
44+
CMD ["/app/start.sh"]

src/server/main/requirements.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
fastapi
22
uvicorn
3-
pydantic
43
python-dotenv
4+
motor
55
python-jose[cryptography]
66
cryptography
7-
httpx
8-
nest_asyncio
9-
json5
107
requests
11-
motor
12-
pymongo
8+
httpx
139
qwen-agent
10+
celery
11+
redis
1412
google-api-python-client
15-
google-auth-httplib2
1613
google-auth-oauthlib
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
fastmcp
22
python-dotenv
3-
google-api-python-client
4-
google-auth-httplib2
5-
google-auth-oauthlib
63
motor
74
cryptography
8-
httpx
5+
google-api-python-client
6+
google-auth-oauthlib
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
fastmcp
22
python-dotenv
3-
google-api-python-client
4-
google-auth-httplib2
5-
google-auth-oauthlib
63
motor
74
cryptography
5+
google-api-python-client
6+
google-auth-oauthlib
87
httpx
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
fastmcp
22
python-dotenv
3-
google-api-python-client
4-
google-auth-httplib2
5-
google-auth-oauthlib
63
motor
7-
cryptography
4+
cryptography
5+
google-api-python-client
6+
google-auth-oauthlib
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
fastmcp
22
python-dotenv
3-
google-api-python-client
4-
google-auth-httplib2
5-
google-auth-oauthlib
63
motor
74
cryptography
5+
google-api-python-client
6+
google-auth-oauthlib
87
httpx
98
sentence-transformers
109
torch
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
fastmcp
22
python-dotenv
3-
google-api-python-client
4-
google-auth-httplib2
5-
google-auth-oauthlib
63
motor
74
cryptography
85
httpx
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
fastmcp
22
python-dotenv
3-
google-api-python-client
4-
google-auth-httplib2
5-
google-auth-oauthlib
63
motor
74
cryptography
8-
httpx
5+
google-api-python-client
6+
google-auth-oauthlib
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
fastmcp
22
python-dotenv
3-
google-api-python-client
4-
google-auth-httplib2
5-
google-auth-oauthlib
63
motor
74
cryptography
5+
google-api-python-client
6+
google-auth-oauthlib
87
httpx
98
matplotlib
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
fastmcp
22
python-dotenv
3-
notion-client
43
motor
54
cryptography
6-
httpx
5+
notion-client

0 commit comments

Comments
 (0)