From 96e42454b19f3a7cb1c31250cb40f5396a817015 Mon Sep 17 00:00:00 2001 From: ChrQR Date: Sat, 1 Jun 2024 17:16:31 +0200 Subject: [PATCH] api dockerfile --- api/Dockerfile | 12 ++++++------ api/api.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 8978f26..a49483c 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,17 +1,17 @@ -# Use an official Python runtime as a parent image +# Use the official Python image from the Docker Hub FROM python:3.9-slim -# Set the working directory in the container +# Set the working directory inside the container WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app -# Install any needed packages specified in requirements.txt -RUN pip install --no-cache-dir -r requirements.txt +# Install the required Python packages +RUN pip install -r requirements.txt -# Make port 5000 available to the world outside this container +# Expose port 5000 to the outside world EXPOSE 5000 -# Run gunicorn server +# Command to run the app using Gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:5000", "app:app"] diff --git a/api/api.py b/api/api.py index 827495c..0c1b9d2 100644 --- a/api/api.py +++ b/api/api.py @@ -20,4 +20,4 @@ def get_jobs(): return jsonify(jobs) if __name__ == '__main__': - app.run(debug=False, host='0.0.0.0') + app.run(host='0.0.0.0', port=5000)