-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (40 loc) · 1.41 KB
/
Dockerfile
File metadata and controls
62 lines (40 loc) · 1.41 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
61
62
FROM python:3.14-slim AS builder
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /ws
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN python -m venv /opt/venv && \
/opt/venv/bin/pip install --upgrade pip && \
/opt/venv/bin/pip install --no-cache-dir -r requirements.txt
FROM python:3.14-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="/opt/venv/bin:$PATH"
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home /home/archsaurus \
--shell /sbin/nologin \
--uid "$UID" \
archsaurus
RUN apt-get update && apt-get install -y --no-install-recommends postgresql-client
WORKDIR /ws
COPY --from=builder /opt/venv /opt/venv
COPY --chown=archsaurus:archsaurus wallet_service ./wallet_service
COPY --chown=archsaurus:archsaurus alembic.ini .
COPY --chown=archsaurus:archsaurus ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
USER archsaurus
ENTRYPOINT ["/entrypoint.sh"]
CMD ["uvicorn", "wallet_service.application.main:wallet_application", \
"--host", "0.0.0.0", "--port", "8000", "--workers", "12", \
"--limit-max-requests", "10000", "--limit-max-requests-jitter", "1000"]