Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
FROM ubuntu:24.10

LABEL maintainer="tomer.klein@gmail.com"
RUN apt update -yqq && \
apt install -yqq python3-pip && \
apt install -yqq libffi-dev && \
apt install -yqq libssl-dev && \
apt install -yqq curl && \
apt install -yqq speedtest-cli && \
apt install -yqq wget

# Install required system dependencies
RUN apt update -yqq && \
apt install -yqq python3 \
python3-pip \
curl \
wget \
speedtest-cli \
--no-install-recommends && \
apt clean && \
rm -rf /var/lib/apt/lists/*

# Set environment variables
ENV API_KEY ""
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

COPY requirements.txt /tmp


RUN pip3 install --upgrade pip --no-cache-dir && \
pip3 install --upgrade setuptools --no-cache-dir

RUN pip3 install -r /tmp/requirements.txt

RUN wget https://raw.githubusercontent.com/sivel/speedtest-cli/v2.1.3/speedtest.py -O /usr/lib/python3/dist-packages/speedtest.py

RUN mkdir /opt/dockerbot
# Create working directory
WORKDIR /opt/dockerbot

COPY dockerbot.py /opt/dockerbot
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir --upgrade pip && \
pip3 install --no-cache-dir -r requirements.txt
Comment on lines +26 to +27

# Install speedtest-cli script
RUN wget https://raw.githubusercontent.com/sivel/speedtest-cli/v2.1.3/speedtest.py -O /usr/local/lib/python3.12/site-packages/speedtest.py

# Copy application code
COPY dockerbot.py .

ENTRYPOINT ["/usr/bin/python3", "/opt/dockerbot/dockerbot.py"]
# Run the application
CMD ["python3", "dockerbot.py"]
Loading