Skip to content

Commit 8376467

Browse files
authored
build: add script to initialize the bot from docker (#15)
Add script to initialize the bot from docker Add script which deploys the new commands before starting.
1 parent 6bd47fb commit 8376467

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,9 @@ COPY . .
1414
# Create data directory for databases
1515
RUN mkdir -p /app/data
1616

17-
# Run the bot from /app/src (but databases write to /app/data)
18-
CMD ["node", "/app/src/index.js"]
17+
# Copy entrypoint script
18+
COPY entrypoint.sh /app/entrypoint.sh
19+
RUN chmod +x /app/entrypoint.sh
20+
21+
# Run deploy-commands before starting bot
22+
ENTRYPOINT ["/app/entrypoint.sh"]

entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
# Docker entrypoint script for CCBot
3+
# Ensures Discord slash commands are deployed before bot startup
4+
5+
set -e
6+
7+
echo "Deploying Discord commands..."
8+
node /app/src/deploy-commands.js
9+
10+
echo "Starting bot..."
11+
node /app/src/index.js

0 commit comments

Comments
 (0)