42 lines
1.3 KiB
Docker
42 lines
1.3 KiB
Docker
# IoT PreTester 4.6 Demo backend
|
|
FROM python:3.10-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
WORKDIR /app
|
|
|
|
# tshark performs capture dissection; nmap and hashcat support opt-in enrichment.
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
hashcat \
|
|
nmap \
|
|
pocl-opencl-icd \
|
|
sqlite3 \
|
|
tshark \
|
|
wget \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN groupadd -g 1000 appgroup \
|
|
&& useradd -m -u 1000 -g 1000 appuser \
|
|
&& mkdir -p /app/data /app/files/uploads /app/logs /app/demo_files /app/django_project/staticfiles \
|
|
&& chown -R appuser:appgroup /app
|
|
|
|
COPY requirements.txt /app/
|
|
RUN pip install --no-cache-dir --upgrade pip \
|
|
&& pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY --chown=appuser:appgroup django_project/ /app/django_project/
|
|
COPY --chown=appuser:appgroup demo_files/demo_wordlist.txt /app/demo_files/demo_wordlist.txt
|
|
COPY --chown=appuser:appgroup docker/entrypoint-backend.sh /app/entrypoint.sh
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
USER appuser
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/api/health || exit 1
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|