Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@
*.pyc
__pycache__
node_modules
ietf/static/ietf/bootstrap
ietf/static/ietf/bootstrap
/docker/docker-compose.extend-custom.yml
2 changes: 1 addition & 1 deletion docker/docker-compose.extend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.8'
services:
app:
ports:
- '8000:8000'
- 'CUSTOM_PORT:8000'
volumes:
- .:/workspace
- /workspace/node_modules
Expand Down
37 changes: 36 additions & 1 deletion docker/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
#!/bin/bash

# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-h] [-p PORT]
Run datatracker in dev containers using docker-compose.

-h display this help and exit
-p PORT use custom HTTP port for datatracker

EOF
}

CUSTOM_PORT=8000

while getopts hp: opt; do
case $opt in
h)
show_help
exit 0
;;
p)
CUSTOM_PORT=$OPTARG
echo "Using custom port $CUSTOM_PORT..."
;;
*)
CUSTOM_PORT=8000
echo "Using port 8000..."
;;
esac
done

cp docker-compose.extend.yml docker-compose.extend-custom.yml
sed -i -r -e "s/CUSTOM_PORT/$CUSTOM_PORT/" docker-compose.extend-custom.yml
cd ..
docker-compose -f docker-compose.yml -f docker/docker-compose.extend.yml up -d
docker-compose -f docker-compose.yml -f docker/docker-compose.extend-custom.yml up -d
docker-compose port db 3306
docker-compose exec app /bin/sh /docker-init.sh
docker-compose stop
cd docker
rm -f docker-compose.extend-custom.yml