add docker support (#1)
This commit is contained in:
parent
6a790440de
commit
ea0b225c65
3 changed files with 64 additions and 1 deletions
24
Dockerfile
Normal file
24
Dockerfile
Normal 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"]
|
13
README.md
13
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 |
|
||||
|
|
26
docker-compose.yaml
Normal file
26
docker-compose.yaml
Normal 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue