File tree Expand file tree Collapse file tree 5 files changed +20
-18
lines changed Expand file tree Collapse file tree 5 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ COPY --from=base /opt/venv /opt/venv
3030# Add default config files
3131COPY octobot/config /octobot/octobot/config
3232
33- COPY docker/*.sh /octobot/
33+ COPY docker/* /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)
@@ -44,7 +44,7 @@ RUN apt-get update \
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 jq 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 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+ import os
2+ import json
3+ from urllib .request import urlopen
4+
5+ if __name__ == '__main__' :
6+ # https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html
7+ container_metadata_url = os .getenv ("ECS_CONTAINER_METADATA_URI_V4" , None )
8+ if container_metadata_url is not None :
9+ try :
10+ with urlopen (container_metadata_url + "/taskWithTags" ) as response :
11+ body = response .read ()
12+ container_metadata = json .loads (body )
13+ for key , value in container_metadata ['TaskTags' ].items ():
14+ os .environ [key ] = value
15+ except Exception as e :
16+ print ("Error when requesting or parsing aws metadata" )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ if [[ -n "${OCTOBOT_CONFIG}" ]]; then
55 echo " $OCTOBOT_CONFIG " | tee /octobot/user/config.json > /dev/null
66fi
77
8- bash aws.sh
8+ python aws.py
9+
910bash tunnel.sh
1011
1112./OctoBot
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments