CoolFace
Apppublic

jerryvig/case_study_rest_api_and_containerization

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
Dockerfile20 linesDownload Raw Back to root
1FROM python:3.9-slim2 3# Set the working directory inside the container4WORKDIR /app5 6# Copy all files from the current directory to the container's working directory7COPY . .8 9# Install dependencies from the requirements file without using cache to reduce image size10RUN pip install --no-cache-dir --upgrade -r requirements.txt11 12EXPOSE 786013ENV PORT=786014 15# Define the command to start the application using Gunicorn with 4 worker processes16# - `-w 4`: Uses 4 worker processes for handling requests17# - `-b 0.0.0.0:7860`: Binds the server to port 7860 on all network interfaces18# - `app:churn_predictor_api`: Runs the Flask app (assuming `app.py` contains the Flask instance named `churn_predictor_api`)19CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:churn_predictor_api"]20