Skip to content

Commit

Permalink
[BS5] use fastapi and aiodocker for dockerapi
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddleSpl0it committed Aug 22, 2022
1 parent 7f70b0f commit db8af3d
Show file tree
Hide file tree
Showing 3 changed files with 649 additions and 4 deletions.
16 changes: 12 additions & 4 deletions data/Dockerfiles/dockerapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ RUN apk add --update --no-cache python3 \
tzdata \
py3-psutil \
&& pip3 install --upgrade pip \
docker \
flask \
flask-restful
fastapi \
uvicorn \
aiodocker \
redis

RUN openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout /app/dockerapi_key.pem \
-out /app/dockerapi_cert.pem \
-subj /CN=dockerapi/O=mailcow \
-addext subjectAltName=DNS:dockerapi

COPY dockerapi.py /app/
COPY async-dockerapi.py /app/

CMD ["python3", "-u", "/app/dockerapi.py"]
CMD ["uvicorn", "--host", "0.0.0.0", "--port", "443", "--ssl-certfile=/app/dockerapi_cert.pem", "--ssl-keyfile=/app/dockerapi_key.pem", "async-dockerapi:app"]
Loading

0 comments on commit db8af3d

Please sign in to comment.