Skip to content

Commit

Permalink
Merge pull request #247 from synfinner/dev
Browse files Browse the repository at this point in the history
Adjust Dockerfile
  • Loading branch information
synfinner authored Dec 6, 2024
2 parents 2a11eed + 9ee86af commit 4515a72
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions Dockerfile
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"]

0 comments on commit 4515a72

Please sign in to comment.