-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 839 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (25 loc) · 839 Bytes
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
# Dockerfile (repo root)
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates curl tini && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Create a fixed non-root user (UID/GID 10001) usable everywhere
RUN groupadd -g 10001 appgroup \
&& useradd -u 10001 -g 10001 -m -s /bin/bash appuser
# Create runtime dirs and grant ownership
RUN mkdir -p /data /app/logs \
&& chown -R 10001:10001 /data /app/logs /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app ./app
# API default
EXPOSE 8000
# RabbitMQ
EXPOSE 15672
# In case an external app need to communicate:
EXPOSE 5672
# default entrypoint: API
CMD ["tini", "--", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]