-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (28 loc) · 923 Bytes
/
Dockerfile
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
# == base ==
FROM python:3.11-slim-bullseye AS base
LABEL maintainer="[email protected]"
WORKDIR /opt/blackledger
RUN apt update \
&& apt-get install -y git postgresql-client \
&& git config --global --add safe.directory /opt/blackledger
COPY ./pyproject.toml setup.cfg ./
COPY ./blackledger/ ./blackledger/
# == deploy ==
FROM base AS deploy
RUN pip install -e .[http]
EXPOSE 8000
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", \
"--bind", "0.0.0.0:8000", "blackledger.http:app"]
# == test ==
FROM base AS test
RUN pip install -e .[http,test]
EXPOSE 8000
CMD ["gunicorn", "-w", "1", "-k", "uvicorn.workers.UvicornWorker", \
"--bind", "0.0.0.0:8000", "blackledger.http:app"]
# == develop ==
FROM base AS develop
RUN pip install -e .[http,dev,test]
EXPOSE 8000
CMD ["bash"]
CMD ["uvicorn", "--reload", \
"--host", "0.0.0.0", "--port", "8000", "blackledger.http:app"]