-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (32 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
42 lines (32 loc) · 1.46 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
36
37
38
39
40
41
42
FROM agnohq/python:3.12
# ---------------------------------------------------------------------------
# Environment
# ---------------------------------------------------------------------------
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/app
# ---------------------------------------------------------------------------
# Create non-root user
# ---------------------------------------------------------------------------
RUN groupadd -g 61000 app \
&& useradd -g 61000 -u 61000 -ms /bin/bash app
# ---------------------------------------------------------------------------
# Application code
# ---------------------------------------------------------------------------
WORKDIR /app
COPY requirements.txt ./
RUN uv pip sync requirements.txt --system
COPY --chown=app:app . .
# ---------------------------------------------------------------------------
# Document seeding: copy sample docs so /documents can be seeded on first run
# ---------------------------------------------------------------------------
RUN mkdir -p /app/documents-seed && cp -r /app/documents/* /app/documents-seed/ 2>/dev/null || true
RUN mkdir -p /documents && chown app:app /documents
# ---------------------------------------------------------------------------
# Entrypoint
# ---------------------------------------------------------------------------
RUN chmod +x /app/scripts/entrypoint.sh
USER app
EXPOSE 8000
ENTRYPOINT ["/app/scripts/entrypoint.sh"]
CMD ["chill"]