-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 1.18 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
FROM python:3.14-slim
LABEL org.opencontainers.image.title="tracekit"
LABEL org.opencontainers.image.description="Tracekit web dashboard and tools"
LABEL org.opencontainers.image.license="CC-BY-NC-4.0"
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PATH="/home/tracekit/.local/bin:${PATH}"
WORKDIR /app
# Install minimal system deps (libpq-dev needed for psycopg2 when not using binary)
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates build-essential libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy project files
COPY . /app
# Install the package and its dependencies from pyproject.toml.
# [production] adds psycopg2-binary for PostgreSQL support.
RUN pip install --upgrade pip setuptools wheel && \
pip install --no-cache-dir ".[production]"
# Create a non-root user
RUN useradd --create-home --shell /bin/bash tracekit \
&& chown -R tracekit:tracekit /app
USER tracekit
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s CMD curl -f http://127.0.0.1:5000/health || exit 1
ARG GIT_SHA
ENV SENTRY_RELEASE=${GIT_SHA}
CMD ["gunicorn", "--config", "/app/app/gunicorn.conf.py", "--chdir", "/app/app", "main:app"]