# Use the official Python image from the Docker Hub
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Install required packages
RUN pip install requests pytube tqdm youtube-search-python
# Copy the rest of the working directory contents into the container at /app
COPY . .
# Define environment variables for default parameters
ENV SERVER_URL="[REDACTED]"
ENV NUM_ITERATIONS=500
ENV NUM_THREADS=30
ENV NUM_INSTANCES=5
# Function to run the main script
CMD ["sh", "-c", "\
echo Starting container... && \
SERVER_URL=${SERVER_URL:-[REDACTED]} && \
NUM_ITERATIONS=${NUM_ITERATIONS:-25} && \
NUM_THREADS=${NUM_THREADS:-30} && \
NUM_INSTANCES=${NUM_INSTANCES:-5} && \
for i in $(seq 1 $NUM_INSTANCES); do \
echo Starting instance $i... && \
python [REDACTED].py $SERVER_URL $NUM_ITERATIONS --threads $NUM_THREADS & \
done && \
wait"]