Docker file example

From PedrosBrainDump
Revision as of 09:40, 11 December 2024 by 413vhcu1lq0463ob (talk | contribs) (Created page with " # Use a python image FROM python:3.9-slim # Define the workdir inside the container WORKDIR /app # Copy the files from local workdir to conainter workdir COPY . . # Install dependencies requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Expose Flask application port EXPOSE 5000 # Command to run the application CMD ["python", "app.py"]")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
# Use a python image
FROM python:3.9-slim

# Define the workdir inside the container
WORKDIR /app

# Copy the files from local workdir to conainter workdir
COPY . .

# Install dependencies requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Expose Flask application port
EXPOSE 5000

# Command to run the application
CMD ["python", "app.py"]