-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathDockerfile
38 lines (28 loc) · 1012 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
36
37
38
# 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
# Use a launch script to support both env variable expansion
# And command line arguments
ENTRYPOINT flask run --host 0.0.0.0 --port "${PORT}" "$@"
####################################
# Production Image
FROM base as production
ENV FLASK_ENV=production
EXPOSE 80
####################################
# Local Development Image
FROM base as development
ENV FLASK_ENV=development
EXPOSE 80