Skip to content

Commit 7dc92c8

Browse files
committed
Fix docker-compose to use base containers
Update database and Hasura images to current ones. Add dependency to Tiamat as Hasura needs it to start.
1 parent da5f66e commit 7dc92c8

3 files changed

Lines changed: 28 additions & 34 deletions

File tree

development.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ ensure_hasura_submodule_initialized() {
7979
echo "jore4-hasura submodule up to date."
8080
}
8181

82-
# jore4-db - Jore 4 database. This is the database used when starting the application.
83-
# jore4-db-test - Jore 4 database instance for the integration tests.
82+
# jore4-testdb - Jore 4 database. This is the database used when starting the application.
83+
# jore4-testdb-test - Jore 4 database instance for the integration tests.
8484
# jore4-hasura - Hasura. We have to start Hasura because it ensures that db migrations are run to the Jore 4 database.
8585
# jore4-hasura-test - Hasura instance used in the integration tests to run db migrations to the Jore 4 database.
8686

8787
function start_all {
8888
download_docker_bundle
89-
$DOCKER_COMPOSE_CMD up -d jore4-db jore4-hasura jore4-db-test jore4-hasura-test
89+
$DOCKER_COMPOSE_CMD up -d jore4-testdb jore4-hasura jore4-testdb-test jore4-hasura-test jore4-tiamat jore4-tiamat-test
9090
$DOCKER_COMPOSE_CMD up --build -d jore4-hastus
9191
prepare_timetables_data_inserter
9292
}
9393

9494
function start_deps {
9595
download_docker_bundle
96-
$DOCKER_COMPOSE_CMD up -d jore4-db jore4-hasura jore4-db-test jore4-hasura-test
96+
$DOCKER_COMPOSE_CMD up -d jore4-testdb jore4-hasura jore4-testdb-test jore4-hasura-test jore4-tiamat jore4-tiamat-test
9797
prepare_timetables_data_inserter
9898
}
9999

docker/.env

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# you may replace the bundled docker image by setting $TESTDB_DOCKER_IMAGE
2-
TESTDB_DOCKER_IMAGE=hsldevcom/jore4-postgres:azuredbmock-main--20230921-953dd291af112be5c6a2b77cf1d62347f9799b42
2+
TESTDB_DOCKER_IMAGE=hsldevcom/jore4-postgres:azuredbmock-main--20240320-51b69beb35e165aa543ec8d360623f10a30e69f0
33

44
# locking hasura image so that we can develop against a static graphql API
55
# Link to available jore4-hasura images in Docker Hub:
66
# https://hub.docker.com/r/hsldevcom/jore4-hasura/tags?page=1&ordering=last_updated
7-
HASURA_DOCKER_IMAGE=hsldevcom/jore4-hasura:hsl-main--20231222-48ba65d784d28460b8738f3e41161a0b13dc1741
7+
HASURA_DOCKER_IMAGE=hsldevcom/jore4-hasura:hsl-main--20240422-e9d5cd9c45df915c55dbb84b5b65bc8f4f342522
8+
9+
TIAMAT_DOCKER_IMAGE=hsldevcom/jore4-tiamat:main--20240527-28ce6b187b6567531b1be163c9d6ae044754f900

docker/docker-compose.custom.yml

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,42 @@ services:
88
build:
99
context: ".."
1010

11-
jore4-db:
12-
container_name: "database"
13-
extends:
14-
service: jore4-testdb
15-
file: docker-compose.yml
16-
image: "${TESTDB_DOCKER_IMAGE}"
17-
ports:
18-
- "127.0.0.1:6432:5432"
19-
20-
jore4-db-test:
11+
jore4-testdb-test:
2112
container_name: "database-test"
2213
extends:
23-
service: jore4-testdb
24-
file: docker-compose.yml
14+
service: jore4-testdb-base
15+
file: docker-compose.base.yml
2516
image: "${TESTDB_DOCKER_IMAGE}"
2617
ports:
2718
- "127.0.0.1:6433:5432"
2819

29-
jore4-hasura:
30-
container_name: "hasura"
31-
image: "${HASURA_DOCKER_IMAGE}"
20+
jore4-tiamat-test:
21+
container_name: "tiamat-test"
3222
extends:
33-
service: jore4-hasura
34-
file: docker-compose.yml
35-
ports:
36-
- "127.0.0.1:3201:8080"
37-
# Waiting for database to be ready to avoid startup delay due to hasura crashing at startup if db is offline
38-
# Note: this should only be done in development setups as Kubernetes does not allow waiting for services to be ready
23+
service: jore4-tiamat-base
24+
file: docker-compose.base.yml
25+
image: "${TIAMAT_DOCKER_IMAGE}"
26+
environment:
27+
- TIAMAT_DB_URL=jdbc:postgresql://jore4-testdb-test:5432/stopdb?stringtype=unspecified
3928
depends_on:
40-
jore4-db:
29+
jore4-testdb-test:
4130
condition: service_healthy
42-
environment:
43-
DB_HOSTNAME: "jore4-db"
4431

4532
jore4-hasura-test:
4633
container_name: "hasura-test"
4734
image: "${HASURA_DOCKER_IMAGE}"
4835
extends:
49-
service: jore4-hasura
50-
file: docker-compose.yml
36+
service: jore4-hasura-base
37+
file: docker-compose.base.yml
5138
ports:
5239
- "127.0.0.1:3202:8080"
5340
depends_on:
54-
jore4-db-test:
41+
jore4-testdb-test:
42+
condition: service_healthy
43+
jore4-tiamat-test:
5544
condition: service_healthy
5645
environment:
57-
DB_HOSTNAME: "jore4-db-test"
46+
- DB_HOSTNAME=jore4-testdb-test
47+
- SKIP_SET_VARIABLE_SECRET_OVERRIDE=true
48+
- TIAMAT_HOSTNAME=jore4-tiamat-test
49+
- TIMETABLESAPI_HOSTNAME=jore4-timetablesapi

0 commit comments

Comments
 (0)