-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
29 lines (22 loc) · 839 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
# Docker file adapted from this tutorial https://github.com/bennzhang/docker-demo-with-simple-python-app
FROM python:3.9.7
# Creating Application Source Code Directory
RUN mkdir -p /usr/src/app
# Setting Home Directory for containers
WORKDIR /usr/src/app
# Installing python dependencies
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
RUN python -c 'from sentence_transformers import SentenceTransformer; SentenceTransformer("all-mpnet-base-v2")'
# Copying src code to Container
COPY . /usr/src/app
# Application Environment variables
#ENV APP_ENV development
ENV PORT 4000
# Exposing Ports
EXPOSE $PORT
# Setting Persistent data
VOLUME ["/app-data"]
# Running Python Application
#CMD gunicorn -b :$PORT -c gunicorn.conf.py main:app
CMD python -m gunicorn --timeout 0 -b :$PORT flask_app:app