fix docker image & sed command (#87)

Signed-off-by: zufardhiyaulhaq <zufardhiyaulhaq@gmail.com>
pull/90/head
Zufar Dhiyaulhaq 2021-02-24 04:23:17 +07:00 zatwierdzone przez GitHub
rodzic f9e3783491
commit b3e1db619a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -3,7 +3,7 @@
# TODO: Check if we can build this FROM python:3-alpine to slim down the image
FROM python:3-slim-buster AS base
FROM python:3.8.8-slim-buster AS base
# Build ARGs
ARG BOT_PROJECT="captcha-bot"
@ -76,8 +76,8 @@ WORKDIR ${BOT_HOME_DIR}
RUN git clone --recurse-submodules ${GITHUB_URL} ${APP_DIR} && \
pip3 install --user --requirement ${APP_DIR}/requirements.txt && \
cd ${APP_DIR}/sources && \
sed -i -e "s/${INVALID_TOKEN}/${BOT_TOKEN}/g" constants.py && \
sed -i -e "s/^\(\s\+\"INIT_LANG\"\)[^:]*:.*/\1 : \"${BOT_LANG}\",/g" constants.py && \
sed -i -e "s/${INVALID_TOKEN}/${BOT_TOKEN}/g" settings.py && \
sed -i -e "s/\"${BOT_LANG}\"/\"${BOT_LANG}\"/g" settings.py && \
chown -cR ${BOT_USER}:${BOT_GROUP} ${BOT_HOME_DIR} && \
rm -rf ${BOT_HOME_DIR}/.cache && \
find ${APP_DIR} -iname '.git*' -print0 | xargs -0 -r -t rm -rf

Wyświetl plik

@ -63,6 +63,12 @@ This will start the container in the background. Use `docker ps` to check if
the container is up and running, and `docker logs captcha-bot` to
investigate the logs.
You can also run with other environment variable. For list of available environment variable, please check `sources/settings.py`. For example:
```bash
docker run -d --name captcha-bot --env CAPTCHABOT_OWNER="@owner" captcha-bot
```
## Stopping the bot
To stop the bot, use