All checks were successful
Deploy / deploy (push) Successful in 20s
Python urllib GET / on 127.0.0.1:8080. start_period=30s gives uvicorn time to boot. Lets Docker mark container unhealthy if webui wedges, and feeds Portainer + diagnose.sh signal that the app is alive. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
43 lines
1.3 KiB
Docker
43 lines
1.3 KiB
Docker
FROM python:3.11-slim
|
|
|
|
RUN apt-get update -qq && \
|
|
apt-get install -y -q --no-install-recommends git && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --no-cache-dir requests fastapi "uvicorn[standard]" pydantic
|
|
|
|
ENV GIT_AUTHOR_NAME=outline-sync \
|
|
GIT_AUTHOR_EMAIL=sync@local \
|
|
GIT_COMMITTER_NAME=outline-sync \
|
|
GIT_COMMITTER_EMAIL=sync@local \
|
|
VAULT_DIR=/vault \
|
|
SETTINGS_PATH=/work/settings.json
|
|
|
|
RUN git config --global user.email "sync@local" && \
|
|
git config --global user.name "outline-sync"
|
|
|
|
ARG APP_VERSION=dev
|
|
ENV APP_VERSION=${APP_VERSION}
|
|
|
|
WORKDIR /work
|
|
|
|
COPY outline_sync.py webui.py entrypoint.sh VERSION ./
|
|
RUN chmod +x entrypoint.sh
|
|
|
|
# Initialise vault with both branches needed by outline_sync.py
|
|
RUN git init /vault && \
|
|
git -C /vault checkout -b main && \
|
|
touch /vault/.gitkeep && \
|
|
git -C /vault add .gitkeep && \
|
|
git -C /vault commit -m "init: empty vault" && \
|
|
git -C /vault checkout -b outline && \
|
|
git -C /vault checkout main
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=30s \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/').close()" || exit 1
|
|
|
|
ENTRYPOINT ["/work/entrypoint.sh"]
|
|
CMD ["uvicorn", "webui:app", "--host", "0.0.0.0", "--port", "8080"]
|