logging_bot / Dockerfile
AstraOS's picture
Update Dockerfile
53cf95f verified
raw
history blame
791 Bytes
# ─────────────── builder stage ───────────────
FROM python:3.9-slim AS builder
WORKDIR /build
# app + deps
COPY requirements.txt .
RUN pip install --prefix=/install --no-cache-dir -r requirements.txt
COPY app.py .
# compile to plain app.pyc in the same dir
RUN python -m compileall -b -f app.py # β†’ /build/app.pyc
# ─────────────── runtime stage ───────────────
FROM python:3.9-slim
WORKDIR /app
# 1) bring the site-packages that were installed into /install
COPY --from=builder /install /usr/local/
# 2) copy only the compiled byte-code
COPY --from=builder /build/app.pyc ./app.pyc
# 3) nothing else to see β€” no source
ENTRYPOINT ["python", "/app/app.pyc"]