-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (33 loc) · 1.44 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (33 loc) · 1.44 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
# ─────────────────────────────────────────────────────────────
# DockView — Dockerfile
# ─────────────────────────────────────────────────────────────
FROM python:3.12-slim AS builder
WORKDIR /build
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install --prefix=/install --no-cache-dir -r requirements.txt
FROM python:3.12-slim AS runtime
LABEL org.opencontainers.image.title="DockView"
LABEL org.opencontainers.image.version="1.0.0"
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq5 \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 dockview
# Fix docker socket access
RUN groupadd -g 999 docker || true
RUN usermod -aG docker dockview
WORKDIR /app
COPY --from=builder /install /usr/local
COPY --chown=dockview:dockview app/ ./app/
USER dockview
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
EXPOSE 8080
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]