feat: add Docker support and database migrations
- Created Dockerfile for building and running the application with Uvicorn. - Added docker-compose.yml to manage application and PostgreSQL service. - Introduced Alembic migrations with initial schema for CRM domain objects. - Configured async SQLAlchemy engine for migrations. - Updated dependencies in uv.lock to include asyncpg, passlib, and pyjwt.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM ghcr.io/astral-sh/uv:python3.14-alpine AS builder
|
||||
WORKDIR /opt/app
|
||||
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN apk add --no-cache build-base libffi-dev \
|
||||
&& uv sync --frozen --no-dev
|
||||
|
||||
# Only application source is copied into the image layer.
|
||||
COPY app ./app
|
||||
|
||||
FROM python:3.14-alpine AS runtime
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PATH="/opt/app/.venv/bin:${PATH}"
|
||||
WORKDIR /opt/app
|
||||
|
||||
RUN apk add --no-cache libstdc++
|
||||
|
||||
COPY --from=builder /opt/app/.venv /opt/app/.venv
|
||||
COPY app ./app
|
||||
|
||||
EXPOSE 8000
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in New Issue
Block a user