Compare commits

..

No commits in common. "main" and "ci/dev-tag-support" have entirely different histories.

4 changed files with 10 additions and 21 deletions

View File

@ -58,8 +58,7 @@ jobs:
tags: |
manticorum67/major-domo-database:${{ steps.version.outputs.version }}
manticorum67/major-domo-database:${{ steps.version.outputs.environment }}
build-args: |
BUILD_VERSION=${{ steps.version.outputs.version }}
manticorum67/major-domo-database:latest
cache-from: type=registry,ref=manticorum67/major-domo-database:buildcache
cache-to: type=registry,ref=manticorum67/major-domo-database:buildcache,mode=max
@ -72,6 +71,7 @@ jobs:
echo "**Image Tags:**" >> $GITHUB_STEP_SUMMARY
echo "- \`manticorum67/major-domo-database:${{ steps.version.outputs.version }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`manticorum67/major-domo-database:${{ steps.version.outputs.environment }}\`" >> $GITHUB_STEP_SUMMARY
echo "- \`manticorum67/major-domo-database:latest\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Build Details:**" >> $GITHUB_STEP_SUMMARY
echo "- Commit: \`${{ steps.version.outputs.sha_short }}\`" >> $GITHUB_STEP_SUMMARY

View File

@ -1,21 +1,16 @@
# Use official Python slim image
FROM python:3.12-slim
# Build-time version arg — passed by CI from the git tag
ARG BUILD_VERSION=dev
LABEL org.opencontainers.image.version=$BUILD_VERSION
# Use specific version for reproducible builds
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.12
# Set Python optimizations
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PIP_NO_CACHE_DIR=1
# Bake the CalVer version into the image so it's readable at runtime
ENV APP_VERSION=$BUILD_VERSION
WORKDIR /usr/src/app
# Install system dependencies (PostgreSQL client libraries)
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
@ -25,15 +20,11 @@ RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY ./app /usr/src/app/app
COPY ./app /app/app
# Create directories for volumes
RUN mkdir -p /usr/src/app/storage
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -f http://localhost:80/health || exit 1
# Start uvicorn
ENV WEB_WORKERS=2
CMD ["sh", "-c", "exec uvicorn app.main:app --host 0.0.0.0 --port 80 --workers $WEB_WORKERS"]
CMD curl -f http://localhost:80/api/v3/current || exit 1

View File

@ -139,11 +139,6 @@ app.include_router(views.router)
logger.info(f"Loaded all routers.")
@app.get("/health")
async def health():
return {"status": "ok", "version": os.environ.get("APP_VERSION", "dev")}
@app.get("/api/docs", include_in_schema=False)
async def get_docs(req: Request):
logger.debug(req.scope)

View File

@ -23,6 +23,9 @@ services:
- LOG_LEVEL=${LOG_LEVEL}
- API_TOKEN=${API_TOKEN}
- TZ=${TZ}
- WORKERS_PER_CORE=1.5
- TIMEOUT=120
- GRACEFUL_TIMEOUT=120
- DATABASE_TYPE=postgresql
- POSTGRES_HOST=sba_postgres
- POSTGRES_DB=${SBA_DATABASE}