diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..38a9d843 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Base image +FROM python:3.10-slim + +# Set working directory inside the container +WORKDIR /app + +# Copy dependency file first for better caching +COPY requirements.txt . + +# Install dependencies (use no-cache to keep image light) +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the project files +COPY . . + +# Expose port 5000 for Flask app +EXPOSE 5000 + +# Default command to run app.py +CMD ["python", "app.py"] diff --git a/README.md b/README.md index 0349143d..5bbe3aef 100644 --- a/README.md +++ b/README.md @@ -110,3 +110,16 @@ 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. + + +## update that i have done as my contribution to kalvium X mathesar + +## 🐳 Running This Project with Docker + +You can run this project easily inside Docker. + +### Build and Run + +```bash +docker build -t vscode-flask-app . +docker run -it -p 5000:5000 vscode-flask-app diff --git a/app.py b/app.py index 8c27ec75..d242eabc 100644 --- a/app.py +++ b/app.py @@ -4,8 +4,11 @@ #----------------------------------------------------------------------------------------- from flask import Flask -app = Flask(__name__) +app = Flask(__name__, static_folder='static', static_url_path='') @app.route("/") def hello(): return app.send_static_file("index.html") + +if __name__ == "__main__": + app.run(host='0.0.0.0', port=5000, debug=True)