This commit is contained in:
Tobias Brunner 2025-01-30 17:15:36 +01:00
parent 532a029e61
commit 561cf5764a
No known key found for this signature in database
3 changed files with 9 additions and 5 deletions

View file

@ -14,14 +14,14 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
COPY --from=docker.io/caddy:latest /usr/bin/caddy /usr/local/bin/caddy COPY --from=docker.io/caddy:latest /usr/bin/caddy /usr/local/bin/caddy
COPY docker/run.sh /usr/local/bin/runhub.sh COPY docker/run.sh /usr/local/bin/runhub.sh
COPY docker/Caddyfile /etc/caddy/Caddyfile COPY docker/Caddyfile /app/config/caddy/Caddyfile
ADD . /app ADD . /app
RUN uv sync --frozen \ RUN uv sync --frozen \
&& uv pip install gunicorn --no-cache-dir \ && uv pip install gunicorn --no-cache-dir \
&& chmod a+x /usr/local/bin/runhub.sh \ && chmod a+x /usr/local/bin/runhub.sh \
&& mkdir -p /app/run && chgrp -R 0 /app/run && chmod -R g=u /app/run \ && mkdir -p /app/config/caddy /app/run/caddy /app/run/gunicorn && chgrp -R 0 /app && chmod -R g=u /app && chmod g+w /app/config/caddy/Caddyfile \
&& SECRET_KEY= python -m hub collectstatic --noinput && SECRET_KEY= python -m hub collectstatic --noinput
CMD ["/usr/local/bin/runhub.sh"] CMD ["/usr/local/bin/runhub.sh"]

View file

@ -4,7 +4,7 @@
log { log {
output stderr output stderr
format console format console
level ERROR level INFO
} }
} }

View file

@ -2,18 +2,22 @@
# Create required directories with appropriate permissions # Create required directories with appropriate permissions
mkdir -p /app/run/caddy /app/run/gunicorn mkdir -p /app/run/caddy /app/run/gunicorn
chmod -R g+w /app/run
# Set Caddy config location
export XDG_CONFIG_HOME="/app/config"
echo "Applying database migrations" echo "Applying database migrations"
python -m hub migrate python -m hub migrate
echo "Starting Caddy" echo "Starting Caddy"
caddy run --config /etc/caddy/Caddyfile & exec caddy run --config /app/config/caddy/Caddyfile --adapter caddyfile 2>&1 &
echo "Starting Gunicorn" echo "Starting Gunicorn"
exec \ exec \
gunicorn \ gunicorn \
-w 4 \ -w 4 \
--access-logfile None \ --access-logfile - \
--error-log - \ --error-log - \
--capture-output \ --capture-output \
--pythonpath /app/.venv/lib/python3.13/site-packages/ \ --pythonpath /app/.venv/lib/python3.13/site-packages/ \