add docker support (#1)

This commit is contained in:
HappyLoLTroll 2025-04-15 21:12:27 +02:00 committed by GitHub
parent 6a790440de
commit ea0b225c65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 1 deletions

24
Dockerfile Normal file
View file

@ -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"]

View file

@ -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 |

26
docker-compose.yaml Normal file
View file

@ -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