-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 877 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (22 loc) · 877 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
FROM python:3.12-slim AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# Install dependencies first for layer caching.
COPY pyproject.toml README.md ./
COPY src ./src
RUN pip install --no-cache-dir .
# Seed corpus ships with the image; vector data lives on a volume.
COPY data/corpus ./data/corpus
RUN useradd --create-home --uid 10001 atlas \
&& mkdir -p /app/data/vectorstore \
&& chown -R atlas:atlas /app
USER atlas
ENV ATLAS_API_HOST=0.0.0.0 \
ATLAS_API_PORT=8000 \
ATLAS_PERSIST_DIR=/app/data/vectorstore \
ATLAS_CORPUS_DIR=/app/data/corpus
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
ENTRYPOINT ["uvicorn", "atlas.api.app:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000"]