forked from DeSci-md/automating-metadata-v1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·28 lines (21 loc) · 910 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
# Use a base image with Python installed
FROM python:3.9
# Set the working directory in the container
WORKDIR /
# we put this before the COPY app step just to cache the installation of the requirements, so if we make code changes without requirements updates builds are faster
COPY ./app/requirements.txt ./app/requirements.txt
RUN pip install -r ./app/requirements.txt
# Copy the script and requirements file into the container
COPY ./app ./app
# Install dependencies
RUN pip install gunicorn
#run service - Expose (what is the request response model)
EXPOSE 5001
EXPOSE 5005
ENV FLASK_APP=server.py
WORKDIR /app
ENV PYTHONPATH=/app
# Define the command to run when the container starts
# CMD ["flask", "run", "--host=0.0.0.0", "--port=5001"]
# gunicorn is a production ready web server for flask, with ability to handle multiple requests
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5001", "server:app"]