All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m5s
Combines shared, blog, market, cart, events, federation, and account into a single repository. Eliminates submodule sync, sibling model copying at build time, and per-app CI orchestration. Changes: - Remove per-app .git, .gitmodules, .gitea, submodule shared/ dirs - Remove stale sibling model copies from each app - Update all 6 Dockerfiles for monorepo build context (root = .) - Add build directives to docker-compose.yml - Add single .gitea/workflows/ci.yml with change detection - Add .dockerignore for monorepo build context - Create __init__.py for federation and account (cross-app imports)
51 lines
1.3 KiB
Docker
51 lines
1.3 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# ---------- Python application ----------
|
|
FROM python:3.11-slim AS base
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PYTHONPATH=/app \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
APP_PORT=8000 \
|
|
APP_MODULE=app:app
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system deps + psql client
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
postgresql-client \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY shared/requirements.txt ./requirements.txt
|
|
RUN pip install -r requirements.txt
|
|
|
|
# Shared code (replaces submodule)
|
|
COPY shared/ ./shared/
|
|
|
|
# App code
|
|
COPY account/ ./
|
|
|
|
# Sibling models for cross-domain SQLAlchemy imports
|
|
COPY blog/__init__.py ./blog/__init__.py
|
|
COPY blog/models/ ./blog/models/
|
|
COPY market/__init__.py ./market/__init__.py
|
|
COPY market/models/ ./market/models/
|
|
COPY cart/__init__.py ./cart/__init__.py
|
|
COPY cart/models/ ./cart/models/
|
|
COPY events/__init__.py ./events/__init__.py
|
|
COPY events/models/ ./events/models/
|
|
COPY federation/__init__.py ./federation/__init__.py
|
|
COPY federation/models/ ./federation/models/
|
|
|
|
# ---------- Runtime setup ----------
|
|
COPY account/entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
RUN useradd -m -u 10001 appuser && chown -R appuser:appuser /app
|
|
USER appuser
|
|
|
|
EXPOSE ${APP_PORT}
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|