-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
41 lines (29 loc) · 1.04 KB
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
36
37
38
39
40
41
# Use official Python base image
FROM python:3.9-slim-buster as base
ENV APP_INSTALL=/app
ENV PYTHONPATH=${APP_INSTALL}
ENV PORT=80
ENV ACCEPT_EULA=Y
# Install required tools
RUN apt-get update && apt-get install curl gnupg apt-transport-https ca-certificates -y
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update && apt-get install unixodbc-dev g++ msodbcsql17 mssql-tools -y
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . /app
WORKDIR /app
####################################
# Production Image
FROM base as production
ENV FLASK_ENV=production
EXPOSE 80
ENTRYPOINT gunicorn "app:app" -b 0.0.0.0:$PORT "$@"
####################################
# Local Development Image
FROM base as development
ENV FLASK_ENV=development
EXPOSE 80
# Use a launch script to support both env variable expansion
# And command line arguments
ENTRYPOINT flask run --host 0.0.0.0 --port "${PORT}" "$@"