Files
firefox-accounts-mirror/_scripts/pushbox-db.sh
dschom 1ab4ba501b task(shared): Fix docker network error with otel
Because:
- When starting tracing with open telemetry the network name would sometimes collide and result in error.

This Commit:
- Sets an 'fxa' network name
- Applies this network to services
- Allows services to communicate by their names
2022-11-04 16:22:11 -07:00

27 lines
635 B
Bash
Executable File

#!/bin/bash -ex
# This docker image doesn't react to SIGINTs (Ctrl+C) which is used by
# pm2 to kill processes.
# We go around this by defining a SIGINT handler, running docker in the
# background (but still logging on the screen), and running a read to keep
# the script running.
function on_singint() {
echo "Pushbox DB shutting down."
docker stop pushbox_db
exit 0
}
trap on_singint INT
docker run --rm --name pushbox_db \
--net fxa \
-p 4306:3306 \
-e MYSQL_ROOT_PASSWORD=random \
-e MYSQL_DATABASE=pushbox \
-e MYSQL_USER=test \
-e MYSQL_PASSWORD=test \
mysql/mysql-server:5.6 &
while :; do read -r; done