[Docker] Add entrypoint with config dump

This commit is contained in:
Herklos
2020-10-27 18:56:43 +01:00
committed by Herklos
parent 17c765c8ff
commit 6f6aab2e07
2 changed files with 12 additions and 2 deletions

View File

@@ -18,13 +18,16 @@ FROM python:3.8-slim-buster
WORKDIR /octobot
COPY --from=base /opt/venv /opt/venv
COPY octobot/config /octobot/octobot/config
COPY docker-entrypoint.sh docker-entrypoint.sh
RUN apt-get update \
&& apt-get install -y --no-install-recommends libxslt-dev libxcb-xinput0 libjpeg62-turbo-dev zlib1g-dev libblas-dev liblapack-dev libatlas-base-dev libopenjp2-7 libtiff-dev \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /opt/venv/bin/OctoBot OctoBot # Make sure we use the virtualenv
&& ln -s /opt/venv/bin/OctoBot OctoBot # Make sure we use the virtualenv \
&& chmod +x docker-entrypoint.sh
VOLUME /octobot/tentacles
VOLUME /octobot/user
EXPOSE 5001
ENTRYPOINT ["./OctoBot"]
ENTRYPOINT ["./docker-entrypoint.sh"]

7
docker-entrypoint.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
if [[ -n "${OCTOBOT_CONFIG}" ]]; then
echo "$OCTOBOT_CONFIG" | tee /octobot/user/config.json > /dev/null
fi
./OctoBot