2025-08-16 15:00:36 +02:00
|
|
|
FROM python:3.11-slim
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Install system dependencies
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
|
curl \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Copy requirements and install Python dependencies
|
|
|
|
|
COPY services/pos/requirements.txt .
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
# Copy application code
|
|
|
|
|
COPY services/pos/app ./app
|
|
|
|
|
COPY shared ./shared
|
|
|
|
|
|
2025-09-30 13:32:51 +02:00
|
|
|
# Copy migrations and alembic config
|
|
|
|
|
COPY services/pos/migrations/ /app/migrations/
|
|
|
|
|
COPY services/pos/alembic.ini /app/alembic.ini
|
|
|
|
|
|
|
|
|
|
# Copy scripts directory
|
|
|
|
|
COPY scripts ./scripts
|
|
|
|
|
|
2025-08-16 15:00:36 +02:00
|
|
|
# Create necessary directories
|
|
|
|
|
RUN mkdir -p logs
|
|
|
|
|
|
|
|
|
|
# Set Python path
|
|
|
|
|
ENV PYTHONPATH=/app
|
|
|
|
|
|
|
|
|
|
# Expose port
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
|
|
# Health check
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
|
|
|
CMD curl -f http://localhost:8000/health || exit 1
|
|
|
|
|
|
|
|
|
|
# Run the application
|
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|