Implement running Discord and 4chan gathering simultaneously

This commit is contained in:
2022-09-02 22:30:45 +01:00
commit 36de004ee5
12 changed files with 532 additions and 0 deletions

23
docker/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# syntax=docker/dockerfile:1
FROM python:3
RUN useradd -d /code pathogen
RUN mkdir /code
RUN chown pathogen:pathogen /code
RUN mkdir /venv
RUN chown pathogen:pathogen /venv
USER pathogen
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /code
COPY requirements.txt /code/
COPY discord-patched.tgz /code/
RUN python -m venv /venv
RUN . /venv/bin/activate && pip install -r requirements.txt
RUN tar xf /code/discord-patched.tgz -C /venv/lib/python3.10/site-packages
CMD . /venv/bin/activate && exec python monolith.py

BIN
docker/discord-patched.tgz Normal file

Binary file not shown.

View File

@@ -0,0 +1,31 @@
version: "2"
services:
app:
image: pathogen/monolith:latest
build: ./docker
volumes:
- ${PORTAINER_GIT_DIR}:/code
env_file:
- .env
volumes_from:
- tmp
tmp:
image: busybox
command: chmod -R 777 /var/run/redis
volumes:
- /var/run/redis
redis:
image: redis
command: redis-server /etc/redis.conf
volumes:
- ${PORTAINER_GIT_DIR}/docker/redis.conf:/etc/redis.conf
volumes_from:
- tmp
networks:
default:
external:
name: pathogen

2
docker/redis.conf Normal file
View File

@@ -0,0 +1,2 @@
unixsocket /var/run/redis/redis.sock
unixsocketperm 777

7
docker/requirements.txt Normal file
View File

@@ -0,0 +1,7 @@
wheel
treq
beautifulsoup4
redis
siphashc
aiohttp
python-dotenv