Skip to content

Commit 9e600f9

Browse files
committed
Add envs folder and update compose for testing
Ref: #69
1 parent adbaa65 commit 9e600f9

File tree

4 files changed

+55
-40
lines changed

4 files changed

+55
-40
lines changed

Diff for: docker-compose.yaml

+23-40
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,42 @@
11
version: '3.1'
22
services:
3-
devbox-db:
4-
image: "healthsamurai/aidboxdb:14.5"
3+
aidbox-db:
4+
image: "healthsamurai/aidboxdb:16.1"
5+
env_file:
6+
- ./envs/db
57
ports:
6-
- "5434:5432"
7-
environment:
8-
POSTGRES_USER: postgres
9-
POSTGRES_PASSWORD: postgres
10-
POSTGRES_DB: devbox
11-
devbox:
12-
image: "healthsamurai/aidboxone:latest"
8+
- 5432:5432
9+
healthcheck:
10+
test: ["CMD", "pg_isready", "-U", "postgres"]
11+
interval: 5s
12+
timeout: 5s
13+
retries: 10
14+
aidbox:
15+
image: ${AIDBOX_PROJECT_IMAGE}
16+
build: example/aidbox-project/
1317
depends_on:
14-
- devbox-db
15-
links:
16-
- "devbox-db:database"
17-
ports:
18-
- "8080:8080"
18+
aidbox-db:
19+
condition: service_healthy
1920
env_file:
20-
- env_tests
21+
- ./envs/aidbox
2122
environment:
22-
PGHOST: database
23-
PGDATABASE: devbox
24-
PGPORT: 5432
25-
PGUSER: postgres
26-
PGPASSWORD: postgres
27-
AIDBOX_CONFIG: /var/config/config.edn
2823
AIDBOX_LICENSE: ${AIDBOX_LICENSE}
29-
volumes:
30-
- ./config:/var/config
31-
devbox-healthcheck:
32-
image: curlimages/curl
33-
entrypoint: /bin/sleep 10000
34-
links:
35-
- devbox
36-
depends_on:
37-
- devbox
3824
healthcheck:
39-
test: curl --fail http://devbox:8080/__healthcheck || exit 1
40-
interval: 1s
41-
timeout: 20s
42-
retries: 100
25+
test: curl --fail http://localhost:8080/health || exit 1
26+
interval: 5s
27+
timeout: 30s
28+
retries: 50
4329
app:
4430
build:
4531
context: .
4632
args:
4733
PYTHON_VERSION: ${PYTHON:-3.11}
4834
command: ["pipenv", "run", "pytest"]
4935
depends_on:
50-
devbox-healthcheck:
51-
condition:
52-
service_healthy
53-
links:
54-
- devbox
36+
aidbox:
37+
condition: service_healthy
5538
env_file:
56-
- env_tests
39+
- ./envs/backend
5740
ports:
5841
- "8081:8081"
5942
volumes:

Diff for: envs/aidbox

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
AIDBOX_STDOUT_PRETTY=all
2+
AIDBOX_CLIENT_ID=root
3+
AIDBOX_CLIENT_SECRET=secret
4+
AIDBOX_BASE_URL=http://aidbox:8080
5+
AIDBOX_PORT=8080
6+
AIDBOX_FHIR_VERSION=4.0.0
7+
8+
PGHOST=aidbox-db
9+
PGPORT=5432
10+
PGDATABASE=aidbox-tests
11+
PGUSER=postgres
12+
PGPASSWORD=postgres
13+
14+
BOX_PROJECT_GIT_TARGET__PATH=/aidbox-project
15+
AIDBOX_ZEN_PATHS=path:package-dir:/aidbox-project
16+
AIDBOX_ZEN_ENTRYPOINT=main/box
17+
AIDBOX_DEV_MODE=false
18+
AIDBOX_ZEN_DEV_MODE=false
19+
AIDBOX_COMPLIANCE=enabled

Diff for: envs/backend

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
APP_INIT_CLIENT_ID=root
2+
APP_INIT_CLIENT_SECRET=secret
3+
APP_INIT_URL=http://aidbox:8080
4+
5+
APP_ID=backend-test
6+
APP_SECRET=secret
7+
APP_URL=http://backend:8081
8+
APP_PORT=8081
9+
AIO_PORT=8081
10+
AIO_HOST=0.0.0.0

Diff for: envs/db

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POSTGRES_USER=postgres
2+
POSTGRES_PASSWORD=postgres
3+
POSTGRES_DB=aidbox-tests

0 commit comments

Comments
 (0)