-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247 from synfinner/dev
Adjust Dockerfile
- Loading branch information
Showing
1 changed file
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
# Use the official Python image as the base image | ||
FROM python:3.12 | ||
# Use the official Python-slim image as the base image | ||
FROM python:3.12-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
# Set environment variables to prevent Python from writing pyc files and buffering stdout/stderr | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Install necessary system dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends gcc && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy the requirements file into the container | ||
COPY requirements.txt requirements.txt | ||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Install the required dependencies | ||
RUN pip install -r requirements.txt | ||
# Copy and install dependencies | ||
COPY requirements.txt . | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the entire application directory into the container | ||
# Copy the application code | ||
COPY . . | ||
|
||
# Expose the port that Gunicorn will listen on | ||
# Expose the original port (unchanged) | ||
EXPOSE 8444 | ||
|
||
# Command to run Gunicorn with your Flask app | ||
# Command to run Gunicorn with flask | ||
CMD ["gunicorn", "--bind", "0.0.0.0:8444", "--workers", "4", "--worker-class", "gevent", "--timeout", "30", "--max-requests", "1000", "--max-requests-jitter", "50", "kevin:app"] |