logging_bot / Dockerfile
AstraOS's picture
Update Dockerfile
b8ae194 verified
raw
history blame
565 Bytes
# ---------- builder ----------
FROM python:3.9-slim AS builder
WORKDIR /build
COPY app.py requirements.txt .
RUN pip install --prefix=/install -r requirements.txt
RUN python -m compileall -b -f app.py
RUN tar -C /build -cf /build/app.tgz app.pyc
# ---------- runtime ----------
FROM python:3.9-slim
WORKDIR /app
COPY --from=builder /install /usr/local/
COPY --from=builder /build/app.tgz ./app.tgz
# entrypoint will unpack into /tmp, run, then delete
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]