swiftops-backend / Dockerfile
kamau1's picture
deploy to digital ocean attempt 1
827ddc5
Raw
History Blame Contribute Delete
697 Bytes
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY src/ ./src/
COPY alembic/ ./alembic/
COPY alembic.ini .
# Add src to PYTHONPATH so imports work
ENV PYTHONPATH=/app/src
# Expose port (default 7860, configurable via PORT env variable)
EXPOSE 7860
# Run application from src directory
# Uses PORT env variable if set, otherwise defaults to 7860
CMD cd src && uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-7860}