-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (48 loc) · 1.95 KB
/
Dockerfile
File metadata and controls
60 lines (48 loc) · 1.95 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies including git and docker CLI
RUN apt-get update && apt-get install -y \
sqlite3 \
curl \
git \
ca-certificates \
gnupg \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# Install Docker CLI
RUN install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
chmod a+r /etc/apt/keyrings/docker.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install -y docker-ce-cli docker-compose-plugin && \
rm -rf /var/lib/apt/lists/*
# Configure git globally
RUN git config --global user.name "Claude Code" && \
git config --global user.email "noreply@anthropic.com"
# Create non-root user (UID 99 = 'nobody' on Unraid)
# Add to docker group (GID may vary, will be handled by docker socket permissions)
RUN groupadd -g 99 loggy && \
useradd -u 99 -g 99 -G docker -m -s /bin/bash loggy 2>/dev/null || \
useradd -u 99 -g 99 -m -s /bin/bash loggy
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app/ /app/app/
COPY templates/ /app/templates/
COPY static/ /app/static/
# Create necessary directories and set permissions
RUN mkdir -p /app/data /app/logs /app/exports && \
chown -R loggy:loggy /app
# Switch to non-root user
USER loggy
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:5000/api/health || exit 1
# Expose port
EXPOSE 5000
# Run application
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "5000"]