# Dockerfile - Internal Web Application
# WARNING: This is a deliberately INSECURE Dockerfile for training purposes.
# DO NOT use this in any real environment.

# Use the latest Ubuntu image (unpinned version)
FROM ubuntu:latest

# Set environment variables (including secrets directly in the image)
ENV APP_ENV=production
ENV DB_HOST=db.internal.corp
ENV DB_USER=admin
ENV DB_PASSWORD=Sup3rS3cret!2026
ENV API_KEY=sk-prod-a1b2c3d4e5f6g7h8i9j0
ENV DEBUG=true
ENV FLASK_DEBUG=1

# Install packages as root - including many unnecessary tools
RUN apt-get update && \
    apt-get install -y \
    python3 \
    python3-pip \
    python3-dev \
    vim \
    nano \
    curl \
    wget \
    net-tools \
    iputils-ping \
    traceroute \
    nmap \
    tcpdump \
    strace \
    gdb \
    gcc \
    make \
    git \
    ssh \
    telnet \
    ftp \
    netcat-openbsd \
    socat \
    dnsutils \
    whois \
    htop \
    unzip \
    build-essential

# Copy the ENTIRE project directory into the container
# This will include .env, .git/, credentials/, tests/, docs/, etc.
COPY . /app

WORKDIR /app

# Install Python dependencies as root with no hash verification
RUN pip3 install --break-system-packages -r requirements.txt

# Expose the application port AND a debug port
EXPOSE 5000
EXPOSE 5001
EXPOSE 22

# No HEALTHCHECK defined

# Run the application as root with debug mode enabled
CMD ["python3", "app.py", "--debug", "--host=0.0.0.0"]
