Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main]

env:
POETRY_VERSION: "2.3.0"
POETRY_VERSION: "2.3.1"
POETRY_VIRTUALENVS_IN_PROJECT: true

jobs:
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.14"

- name: Load cached Poetry installation
id: cached-poetry
Expand All @@ -45,9 +45,9 @@ jobs:
uses: actions/cache@v4
with:
path: .venv
key: venv-lint-${{ runner.os }}-py3.12-${{ hashFiles('poetry.lock') }}
key: venv-lint-${{ runner.os }}-py3.14-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-lint-${{ runner.os }}-py3.12-
venv-lint-${{ runner.os }}-py3.14-

- name: Install dependencies
if: steps.cached-venv.outputs.cache-hit != 'true'
Expand All @@ -68,10 +68,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.12
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.14"

- name: Load cached Poetry installation
id: cached-poetry
Expand All @@ -93,9 +93,9 @@ jobs:
uses: actions/cache@v4
with:
path: .venv
key: venv-test-${{ runner.os }}-py3.12-${{ hashFiles('poetry.lock') }}
key: venv-test-${{ runner.os }}-py3.14-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-test-${{ runner.os }}-py3.12-
venv-test-${{ runner.os }}-py3.14-

- name: Install dependencies
if: steps.cached-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -131,10 +131,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python 3.12
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.14"

- name: Load cached Poetry installation
id: cached-poetry
Expand All @@ -156,9 +156,9 @@ jobs:
uses: actions/cache@v4
with:
path: .venv
key: venv-security-${{ runner.os }}-py3.12-${{ hashFiles('poetry.lock') }}
key: venv-security-${{ runner.os }}-py3.14-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-security-${{ runner.os }}-py3.12-
venv-security-${{ runner.os }}-py3.14-

- name: Install dependencies
if: steps.cached-venv.outputs.cache-hit != 'true'
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1

# ============================================================================
# Build stage: Install dependencies using Poetry
# Build stage: Install depend using Poetry
# ============================================================================
FROM python:3.12-slim AS builder
FROM python:3.14-slim AS builder

# Install build dependencies required for compiling Python packages
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
Expand All @@ -15,7 +15,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
curl

# Install Poetry
ENV POETRY_VERSION=2.3.0 \
ENV POETRY_VERSION=2.3.1 \
POETRY_HOME="/opt/poetry" \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
Expand Down Expand Up @@ -48,7 +48,7 @@ RUN --mount=type=cache,target=$POETRY_CACHE_DIR \
# ============================================================================
# Development stage: Full development environment with dev tools
# ============================================================================
FROM python:3.12-slim AS development
FROM python:3.14-slim AS development

LABEL org.opencontainers.image.source="https://github.com/operationcode/back-end"
LABEL org.opencontainers.image.description="Operation Code Backend - Development"
Expand Down Expand Up @@ -96,7 +96,7 @@ CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
# ============================================================================
# Production/Runtime stage: Minimal production image (DEFAULT)
# ============================================================================
FROM python:3.12-slim AS runtime
FROM python:3.14-slim AS runtime

LABEL org.opencontainers.image.source="https://github.com/operationcode/back-end"
LABEL org.opencontainers.image.description="Operation Code Backend - Django API"
Expand Down Expand Up @@ -146,5 +146,5 @@ EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8000/healthz || exit 1

# Run background task processor and gunicorn
CMD ["sh", "-c", "python manage.py qcluster & gunicorn operationcode_backend.wsgi -c gunicorn_config.py"]
# Run gunicorn (qcluster disabled - not currently needed)
CMD ["gunicorn", "operationcode_backend.wsgi", "-c", "gunicorn_config.py"]
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For information about the maintainers of the project, check out [MAINTAINERS.md]

## Quick Start
Recommended versions of tools used within the repo:
- `python@3.12` or greater
- `python@3.14` or greater
- `git@2.17.1` or greater
- `poetry@2.3.0` or greater
- [Poetry](https://python-poetry.org/) is a packaging and dependency manager
Expand Down Expand Up @@ -110,3 +110,20 @@ make clean
# See all available commands
make help
```

## Background Tasks (Django Q)

This project uses Django Q2 for background task processing. The following tasks are defined but **currently disabled**:

- Welcome email on user registration
- Slack invite via PyBot API
- Mailchimp mailing list sync on email confirmation

**Status:** The `qcluster` worker is intentionally disabled in production (see Dockerfile:150). Tasks will queue in the database but won't be processed.

**To re-enable:**
1. Uncomment the qcluster command in `Dockerfile` CMD line
2. Ensure environment variables are configured: `PYBOT_URL`, `PYBOT_AUTH_TOKEN`, `MAILCHIMP_API_KEY`, `MAILCHIMP_LIST_ID`
3. Run worker locally: `python manage.py qcluster`

Task code is preserved in `src/core/tasks.py` and triggered via signals in `src/core/handlers.py`.
Loading