-
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.08 KB
/
Copy pathDockerfile
File metadata and controls
36 lines (26 loc) · 1.08 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
# OpenKyrozen Docker Image
# Build: docker build -t openkyrozen .
# Run: docker run -p 8000:8000 -e DEEPSEEK_API_KEY=sk-... openkyrozen
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for layer caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir fastapi uvicorn
# Copy application code
COPY . .
# Run the service without root privileges. The application only needs to read
# its code and write user data under the mounted working directory/home.
RUN useradd --create-home --uid 10001 --shell /usr/sbin/nologin kyrozen \
&& chown -R kyrozen:kyrozen /app
USER kyrozen
# Expose web server port
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/', timeout=3)"
# Default: run web server
CMD ["python", "server.py", "--host", "0.0.0.0", "--port", "8000"]