init commit
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
# Ubuntu slim base
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
VIRTUAL_ENV=/opt/venv \
|
||||
PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
# copy only requirements first so pip install can be cached
|
||||
COPY app/requirements.txt /app/requirements.txt
|
||||
|
||||
# Minimal runtime: python3 + nmap (+ ca certs/tzdata), clean apt cache
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
python3 python3-venv python3-pip \
|
||||
nmap ca-certificates tzdata && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# ---- Create & activate venv ----
|
||||
RUN python3 -m venv $VIRTUAL_ENV
|
||||
|
||||
# ---- Install Python deps into venv ----
|
||||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||||
|
||||
# ---- App code ----
|
||||
WORKDIR /app
|
||||
COPY app/ /app/
|
||||
|
||||
# Default command
|
||||
ENTRYPOINT ["python3", "/app/main.py"]
|
||||
Reference in New Issue
Block a user