-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (23 loc) · 1016 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
FROM python:3.10-slim
# Makes sure that logs are shown immediately
ENV PYTHONUNBUFFERED=1
# ODBC Drivers for SQL Server
# https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16
RUN apt-get update && apt-get install -y curl gnupg2
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update \
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY ./app /app
COPY ./scripts /scripts
COPY ./sqlite-data /sqlite-data
EXPOSE 8000
# This is for single-container deployments (multiple-workers)
CMD ["gunicorn", "app.main:app", \
"--bind", "0.0.0.0:8000", \
"--access-logfile", "-", \
"--workers", "2", \
"--worker-class", "uvicorn.workers.UvicornWorker"]