Add Docker support and update README with deployment options

- Add Dockerfile with multi-stage build for production deployment
- Add docker-compose.yml for easy local development
- Add .dockerignore to optimize Docker build context
- Update README with Docker and local setup instructions
This commit is contained in:
2025-10-20 19:54:33 -04:00
parent 595440099f
commit 2bf87e6d72
4 changed files with 153 additions and 7 deletions

33
Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# Use Python 3.11 slim image as base
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
FLASK_APP=src/run.py
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create necessary directories for runtime
RUN mkdir -p src/app/static/images src/app/static/barcodes src/app/instance
# Expose port 5555
EXPOSE 5555
# Run the application
CMD ["python", "src/run.py"]