Skip to content

Commit

Permalink
fix(redbot)!: change entrypoint opt in to opt out
Browse files Browse the repository at this point in the history
makes it less awkward to pass args and reduces chances of arg conflict
(if they ever decide to add a --init for some reason)
  • Loading branch information
JJGadgets committed Feb 29, 2024
1 parent 51c3ef7 commit 5f929df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions apps/redbot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ RUN /app/bin/pip install --no-cache-dir --upgrade pip wheel
ARG VERSION
RUN /app/bin/pip install --no-cache-dir --upgrade Red-DiscordBot[postgres]==${VERSION}
# as of 2024-02-04, the bin/redbot just calls redbot.main(), so we might as well override it with our entrypoint.py
COPY --chmod=555 --chown=1000:1000 ./apps/redbot/entrypoint.py /app/bin/redbot
COPY --chmod=555 --chown=1000:1000 ./apps/redbot/entrypoint.py /app/entrypoint.py

USER 1000:1000
ENV BASE_PATH=/config
ENV XDG_CONFIG_HOME=/config/config
ENV CONTAINER_INIT=true
VOLUME ["/config"]
ENTRYPOINT ["/app/bin/redbot"]
CMD ["--init"]

ENTRYPOINT ["/app/bin/python3" "/app/entrypoint.py"]

# Renovate changelogs
LABEL org.opencontainers.image.source="https://github.com/Cog-Creators/Red-Dashboard"
2 changes: 1 addition & 1 deletion apps/redbot/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def prefixAppend(prefix: str):
if os.environ.get("PREFIXES"):
for p in os.environ.get("PREFIXES").strip().split(): prefixAppend(p)

if "--init" in currentArgs:
if "--no-container-init" not in currentArgs or os.environ.get("CONTAINER_INIT") == "true":
print("Configuring RedBot...")
# Stage 1: redbot-setup
with open(configPath + "/Red-DiscordBot/config.json", "w", encoding="utf-8") as f:
Expand Down

0 comments on commit 5f929df

Please sign in to comment.