Skip to content

Commit

Permalink
all data under ./data instead in docker volumes
Browse files Browse the repository at this point in the history
- easier backups
- people can access recordings with existing scripts
  • Loading branch information
alangecker committed Jan 7, 2024
1 parent 72bd71c commit a3f346d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
29 changes: 13 additions & 16 deletions docker-compose.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ services:
ENABLE_LEARNING_DASHBOARD: ${ENABLE_LEARNING_DASHBOARD:-true}
NUMBER_OF_BACKEND_NODEJS_PROCESSES: {{ .Env.NUMBER_OF_BACKEND_NODEJS_PROCESSES }}
volumes:
- bigbluebutton:/var/bigbluebutton
- vol-freeswitch:/var/freeswitch/meetings
- ./data/bigbluebutton:/var/bigbluebutton
- ./data/freeswitch-meetings:/var/freeswitch/meetings
networks:
bbb-net:
ipv4_address: 10.7.7.2
Expand Down Expand Up @@ -167,7 +167,7 @@ services:
volumes:
- ./conf/sip_profiles:/etc/freeswitch/sip_profiles/external
- ./conf/dialplan_public:/etc/freeswitch/dialplan/public_docker
- vol-freeswitch:/var/freeswitch/meetings
- ./data/freeswitch-meetings:/var/freeswitch/meetings
network_mode: host
logging:
# reduce logs to a minimum, so `docker compose logs -f` still works
Expand Down Expand Up @@ -308,7 +308,7 @@ services:
{{end}}
MS_RTP_LISTEN_IP: '{"ip":"0.0.0.0", "announcedIp":"${EXTERNAL_IPv4}"}'
volumes:
- vol-mediasoup:/var/mediasoup
- ./data/mediasoup:/var/mediasoup
tmpfs:
- /var/log/bbb-webrtc-sfu
network_mode: host
Expand Down Expand Up @@ -446,8 +446,8 @@ services:
- mongodb
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- bigbluebutton:/var/bigbluebutton
- vol-mediasoup:/var/mediasoup
- ./data/bigbluebutton:/var/bigbluebutton
- ./data/mediasoup:/var/mediasoup
tmpfs:
- /var/log/bigbluebutton
environment:
Expand Down Expand Up @@ -479,10 +479,9 @@ services:
DOMAIN: ${DOMAIN}
SHARED_SECRET: ${SHARED_SECRET}
volumes:
- bigbluebutton:/var/bigbluebutton
- vol-freeswitch:/var/freeswitch/meetings
- vol-mediasoup:/var/mediasoup
- vol-kurento:/var/kurento
- ./data/bigbluebutton:/var/bigbluebutton
- ./data/freeswitch-meetings:/var/freeswitch/meetings
- ./data/mediasoup:/var/mediasoup
tmpfs:
- /var/log/bigbluebutton
- /tmp
Expand Down Expand Up @@ -583,10 +582,11 @@ services:
SECRET_KEY_BASE: ${RAILS_SECRET}
RELATIVE_URL_ROOT: /
volumes:
- ./greenlight-data:/usr/src/app/storage
- ./data/greenlight:/usr/src/app/storage
networks:
bbb-net:
ipv4_address: 10.7.7.21
{{end}}

postgres:
image: postgres:16-alpine
Expand All @@ -601,6 +601,7 @@ services:
timeout: 5s
retries: 5
volumes:
- ./data/postgres:/var/lib/postgresql/data
- ./mod/postgres/initdb.sh:/docker-entrypoint-initdb.d/initdb.sh
networks:
bbb-net:
Expand All @@ -620,7 +621,7 @@ services:
ipv4_address: 10.7.7.33
{{ if isTrue .Env.ENABLE_PROMETHEUS_EXPORTER_OPTIMIZATION }}
volumes:
- bigbluebutton:/var/bigbluebutton:ro
- ./data/bigbluebutton:/var/bigbluebutton:ro
{{end}}

# the exporter requires /etc/bigbluebutton/bigbluebutton-release
Expand All @@ -631,10 +632,6 @@ services:


volumes:
bigbluebutton:
vol-freeswitch:
vol-kurento:
vol-mediasoup:
html5-static:
{{ if isTrue .Env.ENABLE_HTTPS_PROXY }}
ssl_data:
Expand Down
24 changes: 24 additions & 0 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ else
echo "# recreate docker-compose.yml"
./scripts/generate-compose


echo ""
echo "# checking for old volumes & migrate them"
COMPOSE_PREFIX=$(docker compose config | grep '^name:' | awk '{print $2}')

function migrate {
VOLUME=${COMPOSE_PREFIX}_${1}
EXISTING=$(docker volume ls | grep $VOLUME | tail -n1 | awk '{print $2}')
if [ -n "$EXISTING" ]; then
# ensure volume is not used
docker compose down --remove-orphans

echo "Migrating $VOLUME to $2"
docker run --rm -v $VOLUME:/src -v $2:/dest --entrypoint /bin/sh eeacms/rsync -c 'rsync -av /src/ /dest'
docker volume rm $EXISTING
fi
}
migrate bigbluebutton ./data/bigbluebutton
migrate vol-freeswitch ./data/freeswitch-meetings
migrate vol-mediasoup ./data/mediasoup

# TODO: migrate postgres database
# TODO: migrate greenlight-data

echo ""
echo "# pull newest images"
docker compose pull --ignore-pull-failures
Expand Down

0 comments on commit a3f346d

Please sign in to comment.