Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 713c65b

Browse files
committed
build: Use host based network for docker:startlocal, drop docker:startdebug, add docker:github
Moving to "host based" networking means there's no need to map port numbers for the docker container. It also lets us access the RabbitMQ management webui on localhost without having to muck around with its config file in the container. RabbitMQ management page, once the container is running: http://localhost:15672 <-- Yep, http. Not https. *** This commit also adds a docker:github target to yarn, as having host based networking running on the test containers during GitHub runs sounds like a potential security problem. eg the ports things are listening on may become world accessible. Not sure, so not taking the chance. ;)
1 parent 9195e59 commit 713c65b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/cypress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
wait-on: 'https://localhost:9443'
2525
wait-on-timeout: 180
2626
build: sh ./build_dbhub_docker_and_local.sh
27-
start: yarn docker:startlocal
27+
start: yarn docker:github
2828
command: yarn cypress:test
2929
env:
3030
NODE_TLS_REJECT_UNAUTHORIZED: 0

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,19 @@
2424
"docker:build": "docker build --tag dbhub-build docker",
2525
"docker:debug": "docker exec -it dbhub-build /bin/sh /usr/local/bin/debug.sh",
2626
"docker:exec": "docker exec -it dbhub-build /bin/sh",
27+
"docker:github": "docker run -itd --rm --name dbhub-build -p 9443-9445:9443-9445/tcp --mount type=bind,src=\"$(pwd)\",target=/dbhub.io dbhub-build:latest",
2728
"docker:psql": "docker exec -it dbhub-build psql -U postgres dbhub",
2829
"docker:recompile": "docker exec -it dbhub-build /bin/sh /usr/local/bin/compile.sh",
2930
"docker:restart": "docker exec -it dbhub-build /bin/sh /usr/local/bin/restart.sh",
30-
"docker:start": "docker run -itd --rm --name dbhub-build -p 9443-9445:9443-9445/tcp dbhub-build:latest",
31-
"docker:startdebug": "docker run -itd --rm --name dbhub-build -p 2345-2347:2345-2347/tcp -p 9443-9445:9443-9445/tcp --mount type=bind,src=\"$(pwd)\",target=/dbhub.io dbhub-build:latest",
32-
"docker:startlocal": "docker run -itd --rm --name dbhub-build -p 9443-9445:9443-9445/tcp --mount type=bind,src=\"$(pwd)\",target=/dbhub.io dbhub-build:latest",
31+
"docker:start": "docker run -itd --rm --name dbhub-build -p 9443-9445:9443-9445/tcp -p 5550:5550/tcp dbhub-build:latest",
32+
"docker:startlocal": "docker run -itd --rm --name dbhub-build --net host --mount type=bind,src=\"$(pwd)\",target=/dbhub.io dbhub-build:latest",
3333
"docker:stop": "docker container stop dbhub-build",
34-
"docker:tail": "docker exec -it dbhub-build tail -F /home/dbhub/output.log"
34+
"docker:tail": "docker exec -it dbhub-build tail -F /home/dbhub/output.log",
35+
"mq:bind": "docker exec -it dbhub-build rabbitmqctl list_bindings",
36+
"mq:conn": "docker exec -it dbhub-build rabbitmqctl list_connections",
37+
"mq:cons": "docker exec -it dbhub-build rabbitmqctl list_consumers",
38+
"mq:ex": "docker exec -it dbhub-build rabbitmqctl list_exchanges",
39+
"mq:q": "docker exec -it dbhub-build rabbitmqctl list_queues"
3540
},
3641
"engines": {
3742
"node": "^18.14.1",

0 commit comments

Comments
 (0)