Add Dockerfile and docker-compose

This commit is contained in:
trueold89 2023-11-02 21:30:00 +03:00
parent 0c1aa0a327
commit 4a23489c1c
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
3 changed files with 41 additions and 1 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM archlinux:base-devel
RUN pacman -Syuu --noconfirm
WORKDIR /opt/aur_builder
RUN useradd -m -g users -G wheel -s /bin/bash aur && echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
ADD https://git.orudo.ru/OrudoCA/aur_builder_bot/releases/download/0.1.0/aur_builder_bot /opt/aur_builder/aur_builder_bot
RUN chmod +x aur_builder_bot && ln -sf /opt/aur_builder/aur_builder_bot /usr/bin/aur_builder_bot && chown aur -R /opt/aur_builder
USER aur
ENTRYPOINT ["aur_builder_bot"]

View File

@ -34,8 +34,31 @@ ln -s /path/to/bot/repo /path/to/repo
### Docker
В разработке
**docker-cli**
```bash
docker run \
--name AUR_Builder_Bot \
--restart=unless-stopped \
-v /path/to/repo:/opt/aur_build/repo \
-e TELOXIDE_TOKEN="<Your_token_here>"
-d orudoca/aur_builder_bot:latest
```
**docker-compose**
```yml
services:
aur_builder_bot:
image: orudoca/aur_builder_bot:latest
container_name: AUR_Builder_Bot
volumes:
- /path/to/repo/:/opt/aur_builder/repo
restart: 'unless-stopped'
environment:
TELOXIDE_TOKEN: "<Your_token_here>"
```
```bash
docker compose up -d
```
## Использоание

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
services:
aur_builder_bot:
image: orudoca/aur_builder_bot:latest
container_name: AUR_Builder_Bot
volumes:
- /path/to/repo/:/opt/aur_builder/repo
restart: 'unless-stopped'
environment:
TELOXIDE_TOKEN: "<Your_token_here>"