From 1ec5ba338a1b27f8feb8736e963b9b1793e86bf7 Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:09:54 -0800 Subject: [PATCH 1/5] Update Dockerfile to use alpine goddamn ubuntu and their snap reqs --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ebffd89..494d103 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM ubuntu:latest +FROM alpine:latest # Install dependencies -RUN apt update && apt install -y python3 python3-pip chromium-browser chromium-chromedriver git +RUN apk update && apk add git build-base linux-headers python3 python3-dev py3-pip chromium chromium-chromedriver # Set working directory WORKDIR /app @@ -17,4 +17,4 @@ COPY . . VOLUME ./run # Run the bot -CMD ["python3", "src/main.py"] \ No newline at end of file +CMD ["python3", "src/main.py"] From 215019dac97cbbc6a4e89ab029418a0cbc567633 Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:10:53 -0800 Subject: [PATCH 2/5] Update Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 494d103..083d4de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ WORKDIR /app # Install pip dependencies COPY requirements.txt . +python3 -m venv .venv && source .venv/bin/activate RUN pip3 install -r requirements.txt # Copy source code From 23e844244e24e48b633ff02e5133707a8d36f22f Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:11:44 -0800 Subject: [PATCH 3/5] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 083d4de..88591d4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /app # Install pip dependencies COPY requirements.txt . -python3 -m venv .venv && source .venv/bin/activate +RUN python3 -m venv .venv && source .venv/bin/activate RUN pip3 install -r requirements.txt # Copy source code From cd6c86243afd22b3097fa05509c4638d17cd1065 Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:16:33 -0800 Subject: [PATCH 4/5] Update Dockerfile --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 88591d4..3720020 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,7 @@ WORKDIR /app # Install pip dependencies COPY requirements.txt . -RUN python3 -m venv .venv && source .venv/bin/activate -RUN pip3 install -r requirements.txt +RUN python3 -m venv .venv && source .venv/bin/activate && pip3 install -r requirements.txt # Copy source code COPY . . From e0c547314db82dde9c026d2b1d593b011c527897 Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Thu, 1 Feb 2024 17:37:51 -0800 Subject: [PATCH 5/5] update Dockerfile and requirements.txt --- Dockerfile | 8 ++++++-- requirements.txt | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3720020..0e6a6dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,18 @@ FROM alpine:latest # Install dependencies -RUN apk update && apk add git build-base linux-headers python3 python3-dev py3-pip chromium chromium-chromedriver +RUN apk update && apk add git build-base linux-headers python3 python3-dev py3-pip py3-opencv chromium chromium-chromedriver # Set working directory WORKDIR /app +# Create virtual environment +# RUN python3 -m venv .venv +# ENV PATH="/app/.venv/bin:$PATH" + # Install pip dependencies COPY requirements.txt . -RUN python3 -m venv .venv && source .venv/bin/activate && pip3 install -r requirements.txt +RUN pip3 install --break-system-packages -r requirements.txt # Copy source code COPY . . diff --git a/requirements.txt b/requirements.txt index b687e64..163d671 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,3 @@ pytz git+https://github.com/muskit/tweety.git tweepy tweet-capture -opencv-python-headless