Add Docker configuration files and update requirements
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,5 +1,5 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.11-slim
|
||||
FROM python:3.10-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
@@ -9,18 +9,18 @@ ENV PYTHONUNBUFFERED 1
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY requirements.txt /app/
|
||||
RUN pip install --upgrade pip && pip install -r requirements.txt
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy project files
|
||||
COPY . /app/
|
||||
COPY . .
|
||||
|
||||
# Expose the port Flask runs on
|
||||
EXPOSE 5000
|
||||
|
||||
# Set environment variable for Flask
|
||||
ENV FLASK_APP=app.py
|
||||
ENV FLASK_RUN_HOST=0.0.0.0
|
||||
ENV FLASK_ENV=production
|
||||
|
||||
# Run the application
|
||||
CMD ["flask", "run"]
|
||||
CMD ["flask", "run", "--host=0.0.0.0"]
|
||||
Reference in New Issue
Block a user