From ea0b225c65ad448f31e780100cd01a9e088b7a18 Mon Sep 17 00:00:00 2001 From: HappyLoLTroll <71263735+HappyLoLTroll@users.noreply.github.com> Date: Tue, 15 Apr 2025 21:12:27 +0200 Subject: [PATCH] add docker support (#1) --- Dockerfile | 24 ++++++++++++++++++++++++ README.md | 15 ++++++++++++++- docker-compose.yaml | 26 ++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c276a35 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM golang:alpine + +RUN apk update && \ + apk upgrade && \ + apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \ + ffmpeg \ + libheif \ + libheif-dev \ + bash \ + git \ + pkgconfig \ + build-base + +WORKDIR /bot + +RUN mkdir downloads + +COPY . . + +RUN chmod +x build.sh + +RUN ./build.sh + +ENTRYPOINT ["./govd"] \ No newline at end of file diff --git a/README.md b/README.md index 4312f00..568396b 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,19 @@ cd govd sh build.sh ``` +## installation with Docker +first build the image using the dockerfile + +```bash +docker build -t govd-bot . +``` + +then edit the .env file and match the DB properties with the MariaDB service environment variables in the docker-compose.yml file and run + +```bash +docker compose up -d +``` + ## env variables | variable | description | default | @@ -68,4 +81,4 @@ some extractors require cookies for download. to add your cookies, just insert a - [ ] add support for telegram wehbhooks - [ ] switch to pgsql (?) - [ ] better API (?) -- [ ] better docs with multiple README \ No newline at end of file +- [ ] better docs with multiple README diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..8875f8c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,26 @@ +services: + govd-bot: + image: govd-bot + restart: unless-stopped + networks: + - govd-network + env_file: + - .env + depends_on: + - db + + db: + image: mysql + restart: unless-stopped + environment: + MYSQL_DATABASE: govd + MYSQL_USER: govd + MYSQL_PASSWORD: password + MYSQL_ROOT_PASSWORD: example + networks: + - govd-network + +networks: + govd-network: + driver: bridge +