-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.backend
More file actions
38 lines (31 loc) · 1008 Bytes
/
Dockerfile.backend
File metadata and controls
38 lines (31 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Common Dependencies
RUN pip install --no-cache-dir \
fastapi \
uvicorn \
numpy \
asyncpg \
websockets \
scipy \
redis \
protobuf \
pyyaml \
python-jose[cryptography] \
passlib \
python-multipart
# Copy application code
COPY backend /app/backend
COPY proto /app/proto
# Compile proto files (we'll do this in the entrypoint or build step)
# For now, let's assume pre-compiled or compile on startup
# But a better practice is to compile here.
# Let's add protoc compiler
RUN apt-get update && apt-get install -y protobuf-compiler && rm -rf /var/lib/apt/lists/*
RUN protoc -I=/app/proto --python_out=/app/backend --pyi_out=/app/backend /app/proto/telemetry.proto
ENV PYTHONPATH=/app
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]