-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (22 loc) · 912 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# Set the working directory
WORKDIR /app
# Copy the requirements.txt file to the working directory
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the current directory contents into the container at /app
COPY . /app
RUN ls -l
# Make port 5000 available to the world outside this container
EXPOSE 5000
# Set environment variable to ensure Python prints everything to the console
#ENV PYTHONUNBUFFERED=1
#ENV FLASK_ENV=development
# Define environment variable
ENV FLASK_APP=app.py
# Run flask command to start the server
#CMD ["flask", "run", "--host=0.0.0.0","--reload", "--debug"]
#https://stackoverflow.com/questions/29663459/why-doesnt-python-app-print-anything-when-run-in-a-detached-docker-container
CMD ["python","-u","app.py"]