Skip to content

Commit

Permalink
Support running as a deps project
Browse files Browse the repository at this point in the history
Signed-off-by: John Gomersall <thegoms@gmail.com>
  • Loading branch information
john-gom committed Aug 12, 2024
1 parent 65561b8 commit 99eca49
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
COMPOSE_FILE=docker-compose.yml;docker/dev.yml
COMPOSE_FILE_RUN=docker-compose.yml,docker-compose-run.yml
COMPOSE_FILE=${COMPOSE_FILE_RUN},docker/dev.yml
COMPOSE_PROJECT_NAME=off-query
COMPOSE_PATH_SEPARATOR=;
COMPOSE_PATH_SEPARATOR=,
RESTART_POLICY=no
TAG=latest
QUERY_PORT=127.0.0.1:5511
Expand All @@ -11,6 +12,7 @@ POSTGRES_USER=productopener
POSTGRES_PASSWORD=productopener
POSTGRES_SHM_SIZE=256m
COMMON_NET_NAME=off_shared_network
# Note when running in a container the following settings are changed to use the internal docker network
MONGO_URI=mongodb://localhost:27017
REDIS_URL=redis://localhost:6379
# Log levels are: debug, verbose, log (default), warn, error
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/container-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
echo "DOCKER_CLIENT_TIMEOUT=120" >> .env
echo "COMPOSE_HTTP_TIMEOUT=120" >> .env
echo "COMPOSE_PROJECT_NAME=off-query" >> .env
echo "COMPOSE_PATH_SEPARATOR=;" >> .env
echo "COMPOSE_PATH_SEPARATOR=," >> .env
echo "RESTART_POLICY=always" >> .env
echo "COMPOSE_FILE=docker-compose.yml" >> .env
echo "TAG=sha-${{ github.sha }}" >> .env
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ endif
up: run_deps
docker compose up --build --wait

# Called by other projects to start this project as a dependency
run: run_deps
COMPOSE_FILE=${COMPOSE_FILE_RUN} docker compose up -d

# This task starts a Postgres database in Docker and then prepares the local environment for development
dev: run_deps
docker compose up --wait query_postgres
Expand Down
6 changes: 6 additions & 0 deletions docker-compose-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
query:
environment:
# Use shared-services MongoDB and REDIS
- MONGO_URI=mongodb://mongodb:27017
- REDIS_URL=redis://redis:6379

0 comments on commit 99eca49

Please sign in to comment.