Skip to content

Commit cf5ac0b

Browse files
committed
Avoid starting the simulator container by default and fail if the ports are in use
1 parent 13c8d48 commit cf5ac0b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

docker-compose.tips.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ services:
5454
dockerfile: crates/simulator/Dockerfile
5555
container_name: tips-simulator
5656
ports:
57-
- "2222:2222"
58-
- "4444:4444"
57+
# Listen on the loopback interface to fail fast if the ports are already in use by op-rbuilder
58+
- "127.0.0.1:2222:2222"
59+
- "127.0.0.1:4444:4444"
5960
volumes:
6061
- ${TIPS_SIMULATOR_DATADIR}:/data
6162
- ${TIPS_SIMULATOR_BUILDER_PLAYGROUND_DIR}:/playground
6263
env_file:
6364
- .env.docker
6465
restart: unless-stopped
66+
profiles:
67+
- simulator

justfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,18 @@ stop-all:
4747
start-all: stop-all
4848
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && mkdir -p data/postgres data/kafka data/minio && docker compose build && docker compose up -d
4949

50+
# Stop only the specified service without stopping the other services or removing the data directories
51+
stop-only program:
52+
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && docker compose down {{ program }}
53+
54+
# Start only the specified service without stopping the other services or removing the data directories
55+
start-only program:
56+
export COMPOSE_FILE=docker-compose.yml:docker-compose.tips.yml && mkdir -p data/postgres data/kafka data/minio && docker compose build && docker compose up -d {{ program }}
57+
5058
# Start every service in docker, except the one you're currently working on. e.g. just start-except ui ingress-rpc
5159
start-except programs: stop-all
5260
#!/bin/bash
53-
all_services=(postgres kafka kafka-setup minio minio-setup ingress-rpc ingres-writer audit maintenance ui simulator)
61+
all_services=(postgres kafka kafka-setup minio minio-setup ingress-rpc ingres-writer audit maintenance ui)
5462
exclude_services=({{ programs }})
5563

5664
# Create result array with services not in exclude list

0 commit comments

Comments
 (0)