diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0b45ca2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,33 @@ +# Ignore Python cache files +__pycache__/ +*.pyc +*.pyo + +# Ignore virtual environments +venv/ +.env/ + +# Ignore test files and directories +tests/ +*.test.* + +# Ignore Docker-specific files +.dockerignore +Dockerfile* + +# Ignore version control files +.git/ +.gitignore + +# Ignore development tools and configs +.idea/ +.vscode/ +*.swp + +# Ignore logs and temp files +*.log +*.tmp +*.bak + +# Images +*.png diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4fb922c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM python:3.10-alpine AS builder + +WORKDIR /app + +RUN apk add --no-cache \ + postgresql-dev \ + gcc \ + musl-dev \ + libffi-dev \ + curl \ + g++ \ + make \ + libxml2-dev \ + libxslt-dev \ + tzdata + +RUN pip install --no-cache-dir poetry + +RUN poetry config virtualenvs.create false + +COPY pyproject.toml poetry.lock ./ +RUN poetry install --only main --no-interaction --no-ansi + +FROM python:3.10-alpine + +WORKDIR /app + +RUN apk add --no-cache \ + postgresql-libs \ + libffi \ + libxml2 \ + libxslt \ + tzdata + +COPY --from=builder /usr/local/lib/python3.10 /usr/local/lib/python3.10 +COPY --from=builder /app /app + +ENV PYTHONPATH=/usr/local/lib/python3.10/site-packages + +COPY . .