-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlask-Dockerfile
30 lines (22 loc) · 924 Bytes
/
Flask-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
# We will use python:3.9-bookworm as the base image for building the Flask container
FROM amd64/python:3.9-bookworm
# ENVVAR for the model
ENV MODEL_PATH=/app/models
# # ENVVAR to disable the TensorFlow optimizations for compatibility with the CPU
# ENV TF_ENABLE_ONEDNN_OPTS=0
# Specifies the working directory where the Docker container will run
WORKDIR /app
# Copying all the application files to the working directory
COPY API/ .
COPY requirements.txt .
COPY models models
# Install all the dependencies required to run the Flask application
RUN pip install --no-cache-dir -r requirements.txt
# Install dependency libGL for OpenCV
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/*
# Expose the Docker container for the application to run on port 443 with ssl/HTTPS
EXPOSE 443
# The command required to run the Dockerized application
CMD ["python", "/app/app.py"]