Merge branch '7-docker' into 'develop'
Additional changes regarding docker See merge request ekzyis/musicube!11
This commit is contained in:
commit
e8f481a493
|
@ -1,5 +1,6 @@
|
||||||
venv
|
venv
|
||||||
__pycache__
|
__pycache__
|
||||||
.env
|
.env
|
||||||
|
docker.env
|
||||||
.coverage
|
.coverage
|
||||||
*cookies.txt
|
*cookies.txt
|
|
@ -11,7 +11,7 @@ RUN pip install -r requirements.txt
|
||||||
|
|
||||||
ARG GIT_COMMIT=unset
|
ARG GIT_COMMIT=unset
|
||||||
ARG DISCORD_BOT_TOKEN=unset
|
ARG DISCORD_BOT_TOKEN=unset
|
||||||
ARG YOUTUBE_COOKIES=youtube.com_cookies.txt
|
ARG YOUTUBE_COOKIES=unset
|
||||||
ENV DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN} YOUTUBE_COOKIES=${YOUTUBE_COOKIES} GIT_COMMIT=${GIT_COMMIT}
|
ENV DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN} YOUTUBE_COOKIES=${YOUTUBE_COOKIES} GIT_COMMIT=${GIT_COMMIT}
|
||||||
|
|
||||||
CMD ["python", "src/bot.py"]
|
CMD ["python", "src/bot.py"]
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
GIT_COMMIT != git log --pretty=format:'%h' -n 1
|
||||||
|
|
||||||
|
build:
|
||||||
|
source <(cat docker.env | sed -e 's/^/export /g')
|
||||||
|
docker build \
|
||||||
|
--build-arg DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN} \
|
||||||
|
--build-arg YOUTUBE_COOKIES=${YOUTUBE_COOKIES} \
|
||||||
|
--build-arg GIT_COMMIT=${GIT_COMMIT} \
|
||||||
|
-t musicube:${GIT_COMMIT} -t musicube:latest \
|
||||||
|
.
|
21
README.md
21
README.md
|
@ -34,3 +34,24 @@ Run bot:
|
||||||
```
|
```
|
||||||
$ python src/bot.py
|
$ python src/bot.py
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Deployment
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker --version
|
||||||
|
Docker version 20.10.8, build 3967b7d28e
|
||||||
|
```
|
||||||
|
|
||||||
|
Build image:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ make build
|
||||||
|
```
|
||||||
|
|
||||||
|
Run image:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ docker run --rm --detach --name musicube musicube:latest
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue