-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathDockerfile
39 lines (28 loc) · 1.03 KB
/
Dockerfile
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
39
# Use an appropriate base image
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
# Install the project into `/app`
WORKDIR /app
# Set environment variables (e.g., set Python to run in unbuffered mode)
ENV PYTHONUNBUFFERED 1
# Install system dependencies for building libraries
RUN apt-get update && apt-get install -y \
build-essential \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy the dependency management files (lock file and pyproject.toml) first
COPY uv.lock pyproject.toml /app/
# Install the application dependencies
RUN uv sync --frozen --no-cache
# Copy your application code into the container
COPY src/ /app/
# Set the virtual environment environment variables
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
# Install the package in editable mode
RUN uv pip install -e .
# Define volumes
VOLUME ["/app/data"]
# Expose the port
EXPOSE 8080
# Run the FastAPI app using uvicorn
CMD ["/app/.venv/bin/fastapi", "run", "ai_companion/interfaces/whatsapp/webhook_endpoint.py", "--port", "8080", "--host", "0.0.0.0"]