Skip to content

Commit abbf859

Browse files
committed
feature: Introduce a production-ready solution for installing the dependencies and dockerizing the image
Signed-off-by: Dimitris Kargatzis <[email protected]>
1 parent 1871f04 commit abbf859

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Dockerfile_prod

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# `python:3.11-slim` image is a lightweight, production-ready Python environment for running Python applications
2+
# in a Docker container. The slim variant of the Python image is smaller than the stretch variant and is optimized for
3+
# production use cases where a smaller image size is preferred.
4+
5+
# Using this image as the base allows you to build a containerized version of your Flask app with the necessary Python
6+
# dependencies without having to install and manage those dependencies on the host machine instead of using the a OS and
7+
# configuring it using a set of instructions in the Dockerfile see the
8+
FROM python:3.11-slim
9+
10+
# Create app directory
11+
WORKDIR /app
12+
13+
# Install app dependencies
14+
# Make sure you have the `requirements.txt` file in the root directory of the project with the required dependencies.
15+
COPY requirements.txt .
16+
RUN pip install --no-cache-dir -r requirements.txt
17+
18+
COPY . .
19+
20+
# OPTIONAL as the `-p` flag is used while running the container
21+
EXPOSE 5000
22+
23+
CMD ["python", "app.py"]

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Flask

0 commit comments

Comments
 (0)