-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (25 loc) · 895 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
FROM python:3.8-alpine AS base
# Maintainer
LABEL maintainer="Pablo Santa Cruz <[email protected]>"
# We need gcc to build some python libraries
RUN apk add build-base
WORKDIR /app
# Install requirements
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy application
COPY . .
# Ports
ENV CONTAINER_PORT=5000 \
BIND_INTERFACE=0.0.0.0 \
GRACEFUL_TIMEOUT=300 \
TIMEOUT=300 \
WORKER_CONNECTIONS=10 \
WORKERS=3 \
DATABASE_URL=sqlite:///./default.db \
LINKA_MASTER_KEY=""
EXPOSE ${CONTAINER_PORT}
# Setup Database
RUN alembic upgrade head
# run gunicorn
CMD ["sh", "-c", "gunicorn --bind ${BIND_INTERFACE}:${CONTAINER_PORT} --graceful-timeout ${GRACEFUL_TIMEOUT} --timeout ${TIMEOUT} --worker-class=uvicorn.workers.UvicornWorker --worker-connections ${WORKER_CONNECTIONS} --workers ${WORKERS} wsgi-service:app"]