-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
19 lines (14 loc) · 833 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM python:3.12
WORKDIR /app
# copy requirements file and config file to the current directory (i.e. /app) in container
COPY ./src/requirements.txt ./
COPY ./src/config.yaml ./
# install the packages from requirements file (without caching the installation files)
RUN pip install --no-cache-dir -r requirements.txt
# copy all the contents from the `src` directory to the `src` folder in container's current directory
# (since docker caches each step in this file sequentially, we first just copied the requirements.txt file and installed the packages.
# so that the next time we change something in our source directory and re-build the image, docker can avoid executing pip install step again
# and just re-execute the actions from this step forward)
COPY ./src ./src/
# finally, run the flask app
CMD ["python", "src/app.py"]