3cf4a9a40a
python / test (push) Failing after 8s
- Updated README.md to reflect new features and API changes. - Introduced versioning in app initialization. - Enhanced configuration management in app/config.py with new validation functions. - Refactored main.py to improve request handling and response generation. - Added new models in app/models.py for structured API responses. - Implemented a dedicated UI rendering function in app/ui.py. - Improved Docker configuration for better security and health checks. - Updated tests to cover new validation rules and response formats. - Added CLAUDE.md for project guidelines and working rules.
47 lines
1.1 KiB
Docker
47 lines
1.1 KiB
Docker
FROM python:3.12-slim-bookworm AS builder
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
PATH="/opt/venv/bin:$PATH"
|
|
|
|
WORKDIR /build
|
|
|
|
RUN python -m venv /opt/venv
|
|
|
|
COPY requirements.txt ./
|
|
RUN pip install --upgrade pip \
|
|
&& pip install -r requirements.txt
|
|
|
|
|
|
FROM python:3.12-slim-bookworm
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PATH="/opt/venv/bin:$PATH"
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends libgl1 libglib2.0-0 libgomp1 \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& groupadd --system app \
|
|
&& useradd --system --gid app --create-home --home-dir /home/app app
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /opt/venv /opt/venv
|
|
COPY app ./app
|
|
COPY docs ./docs
|
|
COPY README.md ./
|
|
COPY docker/entrypoint.sh /entrypoint.sh
|
|
|
|
RUN chmod 0555 /entrypoint.sh \
|
|
&& chown -R app:app /app /opt/venv /home/app /entrypoint.sh
|
|
|
|
USER app
|
|
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 CMD python -c "from urllib.request import urlopen; raise SystemExit(0 if urlopen('http://127.0.0.1:8000/health', timeout=3).getcode() == 200 else 1)"
|
|
|
|
CMD ["/entrypoint.sh"]
|