generated from coop-cloud/example
First version of multi-container Agora that actually works \o/
Running live now at link.agor.ai.
This commit is contained in:
parent
4b32ca5cf7
commit
6145caf372
|
@ -0,0 +1,2 @@
|
|||
export SERVER_ENTRYPOINT_VERSION=2
|
||||
export BRIDGE_ENTRYPOINT_VERSION=2
|
47
compose.yml
47
compose.yml
|
@ -8,12 +8,17 @@ services:
|
|||
- AGORA_PATH=$AGORA_PATH
|
||||
- AGORA_GIT=$AGORA_GIT
|
||||
image: git.coopcloud.tech/flancian/agora-server:latest
|
||||
volumes:
|
||||
- data:$AGORA_PATH
|
||||
configs:
|
||||
- source: server_entrypoint
|
||||
target: /docker-entrypoint.sh
|
||||
mode: 0555
|
||||
entrypoint: /docker-entrypoint.sh
|
||||
ports:
|
||||
- 5017:5017
|
||||
networks:
|
||||
- proxy
|
||||
volumes:
|
||||
- "data:$AGORA_PATH"
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
|
@ -35,37 +40,41 @@ services:
|
|||
# timeout: 10s
|
||||
# retries: 10
|
||||
# start_period: 1m
|
||||
|
||||
|
||||
bridge:
|
||||
environment:
|
||||
- AGORA_USER=$AGORA_USER
|
||||
- AGORA_PATH=$AGORA_PATH
|
||||
- AGORA_GIT=$AGORA_GIT
|
||||
image: git.coopcloud.tech/flancian/agora-bridge:latest
|
||||
configs:
|
||||
- source: bridge_entrypoint
|
||||
target: /docker-entrypoint.sh
|
||||
mode: 0555
|
||||
entrypoint: /docker-entrypoint.sh
|
||||
volumes:
|
||||
- data:$AGORA_PATH
|
||||
- "data:$AGORA_PATH"
|
||||
deploy:
|
||||
restart_policy:
|
||||
delay: 30s
|
||||
condition: on-failure
|
||||
|
||||
# This is meant to run once at the seeding of the Agora, when the AGORA_ROOT (volume) is found empty.
|
||||
# It will clone a git repository into the designated location.
|
||||
bootstrap:
|
||||
environment:
|
||||
- AGORA_USER=$AGORA_USER
|
||||
- AGORA_PATH=$AGORA_PATH
|
||||
- AGORA_GIT=$AGORA_GIT
|
||||
image: git.coopcloud.tech/flancian/agora-bridge:latest
|
||||
command: |
|
||||
bash -c
|
||||
"git clone $AGORA_GIT $AGORA_PATH;
|
||||
cd $AGORA_PATH && git pull"
|
||||
volumes:
|
||||
- data:$AGORA_PATH
|
||||
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
|
||||
configs:
|
||||
server_entrypoint:
|
||||
name: ${STACK_NAME}_server_entrypoint_${SERVER_ENTRYPOINT_VERSION}
|
||||
file: entrypoint.server.sh.tmpl
|
||||
template_driver: golang
|
||||
bridge_entrypoint:
|
||||
name: ${STACK_NAME}_bridge_entrypoint_${BRIDGE_ENTRYPOINT_VERSION}
|
||||
file: entrypoint.bridge.sh.tmpl
|
||||
template_driver: golang
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
# set -eu -o pipefail
|
||||
|
||||
init_root() {
|
||||
git clone ${AGORA_GIT} ${AGORA_PATH} || (cd ${AGORA_PATH} && git pull)
|
||||
}
|
||||
|
||||
main() {
|
||||
set -eu
|
||||
init_root
|
||||
/home/$AGORA_USER/agora-bridge/run-dev.sh
|
||||
}
|
||||
|
||||
main
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
init_root() {
|
||||
set -eu
|
||||
# nothing to do here for now?
|
||||
}
|
||||
|
||||
main() {
|
||||
set -eu
|
||||
init_root
|
||||
/home/$AGORA_USER/agora-server/run-localdev.sh
|
||||
# tail -f /dev/null
|
||||
}
|
||||
|
||||
main
|
Loading…
Reference in New Issue