18 lines
882 B
Docker
18 lines
882 B
Docker
|
|
FROM python:3.12-slim
|
||
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||
|
|
PYTHONUNBUFFERED=1 \
|
||
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
||
|
|
SITEFORGE_DATA_DIR=/data
|
||
|
|
WORKDIR /opt/siteforge
|
||
|
|
COPY requirements.txt ./
|
||
|
|
RUN pip install --no-cache-dir -r requirements.txt && \
|
||
|
|
groupadd -g 10001 siteforge && useradd -u 10001 -g 10001 -s /usr/sbin/nologin siteforge && \
|
||
|
|
mkdir -p /data /published && chown -R siteforge:siteforge /data /published
|
||
|
|
COPY --chown=siteforge:siteforge app/ ./app/
|
||
|
|
COPY --chown=siteforge:siteforge themes/ ./themes/
|
||
|
|
COPY --chown=siteforge:siteforge examples/ ./examples/
|
||
|
|
USER siteforge
|
||
|
|
EXPOSE 8787
|
||
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=25s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8787/api/health', timeout=3)"
|
||
|
|
CMD ["python","-m","uvicorn","app.main:app","--host","0.0.0.0","--port","8787","--proxy-headers"]
|