generated from hjess/PythonTemplateProject
25 lines
588 B
Docker
25 lines
588 B
Docker
# Base image with Python 3.11
|
|
FROM python:3.11-slim
|
|
|
|
# Set the working directory in the container
|
|
WORKDIR /app
|
|
|
|
# Copy the requirements file to the working directory
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Expose the port the app runs on (default Flask port)
|
|
EXPOSE 5000
|
|
|
|
# Define environment variables
|
|
ENV FLASK_APP=app.py
|
|
ENV FLASK_RUN_HOST=0.0.0.0
|
|
ENV PORT=5000
|
|
# Command to run the application
|
|
#CMD ["flask", "run", "--port", "${PORT}"]
|
|
CMD flask run --port ${PORT} |