add dockerfile and prep for prod
This commit is contained in:
parent
8c9671602b
commit
9aeab6ee3b
5 changed files with 94 additions and 1 deletions
27
Dockerfile
Normal file
27
Dockerfile
Normal file
|
@ -0,0 +1,27 @@
|
|||
FROM python:3.13-slim
|
||||
|
||||
EXPOSE 8000
|
||||
WORKDIR /app
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
ENV STATIC_ROOT=/app/staticfiles
|
||||
ENV MEDIA_ROOT=/app/mediafiles
|
||||
|
||||
# Install uv
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
||||
|
||||
# Install Caddy
|
||||
COPY --from=docker.io/caddy:latest /usr/bin/caddy /usr/local/bin/caddy
|
||||
|
||||
COPY docker/run.sh /usr/local/bin/runhub.sh
|
||||
|
||||
ADD . /app
|
||||
|
||||
RUN uv sync --frozen
|
||||
RUN uv pip install gunicorn --no-cache-dir \
|
||||
&& chmod a+x /usr/local/bin/runhub.sh \
|
||||
&& SECRET_KEY= python -m hub collectstatic --noinput
|
||||
|
||||
COPY docker/Caddyfile /etc/caddy/Caddyfile
|
||||
|
||||
CMD ["/usr/local/bin/runhub.sh"]
|
Loading…
Add table
Add a link
Reference in a new issue