# ---------- Dockerfile ----------
# Base image – PHP + Apache
FROM php:apache

# Install Python, NGINX, Supervisor and pip
RUN apt-get update && apt-get install -y \
        python3 \
        python3-pip \
        nginx \
        supervisor \
    && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
#     (add any other libraries you need here)
RUN pip3 install --no-cache-dir \
        flask \
        pyyaml

# Copy your application code & config files
# Website Files
COPY www/ /var/www/html
# Python files
COPY api/ /usr/src/app/
# Config Files
COPY apache_ports.conf /etc/apache2/ports.conf
COPY apache_vhost.conf /etc/apache2/sites-available/000-default.conf
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Expose the ports you care about
EXPOSE 80

#   Start Supervisor
CMD ["/usr/bin/supervisord", "-n"]