initial commit
This commit is contained in:
commit
cc1dc2c4d8
4 changed files with 522 additions and 0 deletions
38
Dockerfile
Normal file
38
Dockerfile
Normal file
|
@ -0,0 +1,38 @@
|
|||
# ┌────────────────────────── build stage ──────────────────────────┐
|
||||
FROM python:3.11-slim as builder
|
||||
WORKDIR /app
|
||||
|
||||
# install build deps if any (none here), copy requirements
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --upgrade pip \
|
||||
&& pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# └────────────────────────── final stage ──────────────────────────┘
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
|
||||
# copy only installed packages from builder (local pip cache)
|
||||
COPY --from=builder /usr/local/lib/python3.11/site-packages \
|
||||
/usr/local/lib/python3.11/site-packages
|
||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||
|
||||
# copy app code
|
||||
COPY app.py .
|
||||
|
||||
# expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# default ENV (you can override these in your orchestrator)
|
||||
ENV BEAVERHABITS_URL="http://beaverhabits.lan" \
|
||||
BEAVERHABITS_USERNAME="changeme" \
|
||||
BEAVERHABITS_PASSWORD="changeme"
|
||||
|
||||
# use a non-root user if you like; for brevity we run as root.
|
||||
|
||||
# run via Gunicorn WSGI server with 4 workers
|
||||
CMD ["gunicorn", "app:app", \
|
||||
"--bind", "0.0.0.0:8000", \
|
||||
"--workers", "4", \
|
||||
"--threads", "4", \
|
||||
"--access-logfile", "-", \
|
||||
"--error-logfile", "-"]
|
Loading…
Add table
Add a link
Reference in a new issue