# syntax=docker/dockerfile:1 FROM python:3.12-slim ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ GARDEN_DATA_DIR=/data \ GARDEN_UPLOAD_DIR=/uploads WORKDIR /srv # Dependencies first for layer caching. COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app ./app COPY docker-entrypoint.sh ./ RUN chmod +x ./docker-entrypoint.sh # Volume mount points; ownership set before dropping privileges. RUN mkdir -p /data /uploads \ && useradd --create-home --uid 10001 garden \ && chown -R garden:garden /data /uploads /srv USER garden EXPOSE 8000 HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8000/api/health', timeout=4).status==200 else 1)" ENTRYPOINT ["./docker-entrypoint.sh"]