diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8bc21e61 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Use the same base image as devcontainer.json +FROM mcr.microsoft.com/devcontainers/python:1-3.12 + +# Set working directory inside the container +WORKDIR /app + +# Copy dependency list and install +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the project files +COPY . . + +# Expose the port used by the app +EXPOSE 9000 + +# Run the sample app +CMD ["python", "app.py"] diff --git a/README.md b/README.md index 0349143d..07677691 100644 --- a/README.md +++ b/README.md @@ -110,3 +110,12 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio Copyright © Microsoft Corporation All rights reserved.
Licensed under the MIT License. See LICENSE in the project root for license information. + +## Docker Setup Instructions (Added by Contributor) + +You can run this project using Docker without installing Python or dependencies locally. + +### Build the Docker image +```bash +docker build -t python-demo . +