File size: 818 Bytes
237bc99
 
 
 
 
 
 
 
0bbb422
237bc99
0bbb422
 
84d66c0
237bc99
0bbb422
237bc99
 
 
 
 
 
0bbb422
237bc99
 
0bbb422
 
 
 
 
237bc99
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
# Use an optimized Python 3.12 slim image
FROM python:3.12-slim

WORKDIR /app

# Install uv for fast dependency resolution
COPY --from=ghcr.io/astral-sh/uv:0.4 /uv /bin/uv

# Copy definition files first for layer caching
COPY pyproject.toml uv.lock ./

# Copy application source
COPY . .

# Install dependencies
RUN uv sync --frozen

# Set environment variables for OpenEnv runtime
ENV PYTHONPATH=/app
ENV ENABLE_WEB_INTERFACE=true

# Expose the default OpenEnv port
EXPOSE 8000

# Health check for container orchestration
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1

# Start the uvicorn server
CMD ["uv", "run", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]