-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
33 lines (28 loc) · 950 Bytes
/
Dockerfile.api
File metadata and controls
33 lines (28 loc) · 950 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
FROM python:3.8-alpine3.15
ENV PYTHONUNBUFFERED=1
ENV FLASK_APP=runserver.py
# Install dependencies needed to build psycopg2
RUN apk update && apk add --no-cache \
gcc \
musl-dev \
python3-dev \
postgresql-dev \
libc-dev \
libffi-dev \
openssl-dev \
build-base \
tzdata \
&& apk add --virtual build-deps gcc musl-dev python3-dev libffi-dev \
&& pip install --upgrade pip
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
EXPOSE 7000
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
#CMD ["python", "runserver.py"]
#CMD ["gunicorn", "-b", "0.0.0.0:7000", "-w", "4", "runserver:app"] # for (celery)
#CMD ["gunicorn", "-b", "0.0.0.0:7000", "-w", "4", "-k", "eventlet", "runserver:app"] # for websocket
CMD ["gunicorn", "-b", "0.0.0.0:7000", "-w", "4", "-k", "gthread", "--threads", "2", "runserver:app"]