-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (18 loc) · 639 Bytes
/
Dockerfile
File metadata and controls
23 lines (18 loc) · 639 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM ubuntu:latest
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
RUN apt update && apt upgrade -y
RUN apt install -y -q build-essential python3-pip python3-dev
RUN pip3 install -U pip setuptools wheel
RUN pip3 install gunicorn uvloop httptools
COPY requirements.txt /app/requirements.txt
RUN pip3 install -r /app/requirements.txt
COPY ./ /app
ENV ACCESS_LOG=${ACCESS_LOG:-/proc/1/fd/1}
ENV ERROR_LOG=${ERROR_LOG:-/proc/1/fd/2}
ENTRYPOINT /usr/local/bin/gunicorn \
-b 0.0.0.0:80 \
-w 4 \
-k uvicorn.workers.UvicornWorker main:app \
--chdir /app \
--access-logfile "$ACCESS_LOG" \
--error-logfile "$ERROR_LOG"