-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
57 lines (57 loc) · 1.96 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: '3'
services:
bot:
build:
context: .
dockerfile: Dockerfile
depends_on:
azurite_init:
condition: service_completed_successfully
volumes:
- .:/usr/src/app
environment:
- SLACK_TOKEN=${SLACK_TOKEN}
- AZURE_CONNECTIONSTRING=${AZURE_CONNECTIONSTRING}
- DEVELOPMENT=true
ports:
- "5000:5000"
expose:
- "5000"
azurite:
image: mcr.microsoft.com/azure-storage/azurite
command: "azurite-blob --blobHost 0.0.0.0"
ports:
- "10000:10000"
expose:
- "10000"
azurite_init:
image: mcr.microsoft.com/azure-cli:latest
command:
- /bin/sh
- -c
- |
# Check if initialized
if az storage container exists --name mariobot-leaderboard | grep -q '"exists": true'; then
echo "Azurite already initialized, skipping..."
exit 0
fi
az storage container create --name mariobot-leaderboard
touch /tmp/leaderboard.json
az storage blob upload --container-name mariobot-leaderboard --type block --name leaderboard.json --content-type application/json --file /tmp/leaderboard.json
touch /tmp/track.json
az storage blob upload --container-name mariobot-leaderboard --type block --name track.json --content-type application/json --file /tmp/track.json
touch /tmp/deadline.json
az storage blob upload --container-name mariobot-leaderboard --type block --name deadline.json --content-type application/json --file /tmp/deadline.json
depends_on:
- azurite
environment:
- AZURE_STORAGE_CONNECTION_STRING=${AZURE_CONNECTIONSTRING}
ngrok:
image: ngrok/ngrok:alpine
environment:
NGROK_AUTHTOKEN: ${NGROK_AUTHTOKEN}
command: 'http bot:5000 --host-header="bot:5000"'
ports:
- "4040:4040"
expose:
- "4040"