-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1.04 KB
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
FROM python:3.13-trixie
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy dependency files first for better caching
COPY pyproject.toml ./
# Copy application code (needed for editable install)
COPY app/ ./app/
COPY configs/ ./configs/
# Install the project in editable mode with dependencies
RUN pip install --group auth --no-cache-dir -e .
# Create groups directory for server mode config storage
RUN mkdir -p /app/groups
# Enable server mode via environment variable
ENV TSCONFIG_SERVER_MODE=true
ENV TSCONFIG_CONFIG_ROOT=/app/groups
ENV TSCONFIG_BASE_URL="/tsconfig"
ENV TSCONFIG_PORT=8000
# Health check to verify the application is running
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:${TSCONFIG_PORT}${TSCONFIG_BASE_URL}/docs || exit 1
# Run the application
CMD ["/bin/sh", "-c", "exec uvicorn app.main:app --host 0.0.0.0 --port ${TSCONFIG_PORT}"]