File tree Expand file tree Collapse file tree 5 files changed +31
-12
lines changed Expand file tree Collapse file tree 5 files changed +31
-12
lines changed Original file line number Diff line number Diff line change @@ -30,21 +30,21 @@ COPY --from=base /opt/venv /opt/venv
3030# Add default config files
3131COPY octobot/config /octobot/octobot/config
3232
33- COPY docker-entrypoint .sh docker-entrypoint.sh
33+ COPY docker/* .sh /octobot/
3434
3535# 1. Install requirements
3636# 2. Add cloudflare gpg key and add cloudflare repo in apt repositories (from https://pkg.cloudflare.com/index.html)
3737# 3. Install required packages
3838# 4. Finish env setup
3939SHELL ["/bin/bash" , "-o" , "pipefail" , "-c" ]
40- RUN apt-get update \
40+ RUN apt-get update \
4141 && apt-get install -y --no-install-recommends curl \
42- && mkdir -p /usr/share/keyrings \
42+ && mkdir -p /usr/share/keyrings \
4343 && chmod 0755 /usr/share/keyrings \
4444 && curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null \
4545 && echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared buster main' | tee /etc/apt/sources.list.d/cloudflared.list \
4646 && apt-get update \
47- && apt-get install -y --no-install-recommends curl cloudflared libxslt-dev libxcb-xinput0 libjpeg62-turbo-dev zlib1g-dev libblas-dev liblapack-dev libatlas-base-dev libopenjp2-7 libtiff-dev \
47+ && apt-get install -y --no-install-recommends jq curl cloudflared libxslt-dev libxcb-xinput0 libjpeg62-turbo-dev zlib1g-dev libblas-dev liblapack-dev libatlas-base-dev libopenjp2-7 libtiff-dev \
4848 && rm -rf /var/lib/apt/lists/* \
4949 && ln -s /opt/venv/bin/OctoBot OctoBot # Make sure we use the virtualenv \
5050 && chmod +x docker-entrypoint.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ source util.sh
4+
5+ # https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html
6+ if [[ -n " $ECS_CONTAINER_METADATA_URI_V4 " ]]; then
7+ AWS_TASK_WITH_TAGS_DETAILS=$( curl --silent " $ECS_CONTAINER_METADATA_URI_V4 /taskWithTags" )
8+ AWS_TASK_TAGS=$( echo $AWS_TASK_WITH_TAGS_DETAILS | jq -r " .TaskTags" )
9+ json_to_env " $AWS_TASK_TAGS "
10+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # #### OctoBot config #####
4+ if [[ -n " ${OCTOBOT_CONFIG} " ]]; then
5+ echo " $OCTOBOT_CONFIG " | tee /octobot/user/config.json > /dev/null
6+ fi
7+
8+ bash aws.sh
9+ bash tunnel.sh
10+
11+ ./OctoBot
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- # OctoBot user config from env
4- if [[ -n " ${OCTOBOT_CONFIG} " ]]; then
5- echo " $OCTOBOT_CONFIG " | tee /octobot/user/config.json > /dev/null
6- fi
7-
8- # #### CLOUDFLARED #####
93export TUNNEL_LOGFILE=/root/cloudflared.log
104export TUNNEL_LOGLEVEL=info
115
126# start cloudflared if token is provided
7+ # https://developers.cloudflare.com/cloudflare-one/tutorials/cli/
138if [[ -n " $CLOUDFLARE_TOKEN " ]]; then
149 cloudflared tunnel --url http://localhost:5001 --no-autoupdate run --token $CLOUDFLARE_TOKEN &
1510fi
16-
17- ./OctoBot
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ json_to_env () {
4+ for s in $( echo $1 | jq -r ' keys[] as $k | "export \($k)=\(.[$k])"' ) ; do export $s ; done
5+ }
You can’t perform that action at this time.
0 commit comments