Add initial setup for Dockerized application
- Added GitHub Actions workflow for building Docker images (.github/workflows/docker-image.yml) - Created Dockerfile for containerizing the application - Implemented main application logic in app.py - Added requirements.txt for managing Python dependencies
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.9-slim
|
||||
|
||||
# Create a working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy requirements and install
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy the application code
|
||||
COPY app.py .
|
||||
|
||||
# Expose the port Flask will run on (5000 by default)
|
||||
EXPOSE 5000
|
||||
|
||||
# Run the app
|
||||
CMD ["python", "app.py"]
|
||||
Reference in New Issue
Block a user