|
| 1 | +services: |
| 2 | + postgres: |
| 3 | + image: postgres:15-alpine |
| 4 | + container_name: webapi-postgres |
| 5 | + environment: |
| 6 | + POSTGRES_USER: postgres |
| 7 | + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres} |
| 8 | + POSTGRES_DB: ohdsi |
| 9 | + healthcheck: |
| 10 | + test: ["CMD-SHELL", "pg_isready -U postgres"] |
| 11 | + interval: 5s |
| 12 | + timeout: 5s |
| 13 | + retries: 10 |
| 14 | + networks: |
| 15 | + - webapi-network |
| 16 | + |
| 17 | + cdm-db: |
| 18 | + image: ohdsi/broadsea-atlasdb:2.3.0 |
| 19 | + container_name: cdm-db |
| 20 | + healthcheck: |
| 21 | + test: ["CMD-SHELL", "pg_isready -U postgres"] |
| 22 | + interval: 5s |
| 23 | + timeout: 5s |
| 24 | + retries: 10 |
| 25 | + networks: |
| 26 | + - webapi-network |
| 27 | + |
| 28 | + cdm-db-debug: |
| 29 | + image: ohdsi/broadsea-atlasdb:2.3.0 |
| 30 | + container_name: cdm-db-debug |
| 31 | + profiles: ["debug"] |
| 32 | + healthcheck: |
| 33 | + test: ["CMD-SHELL", "pg_isready -U postgres"] |
| 34 | + interval: 5s |
| 35 | + timeout: 5s |
| 36 | + retries: 10 |
| 37 | + ports: |
| 38 | + - "5433:5432" |
| 39 | + networks: |
| 40 | + - webapi-network |
| 41 | + |
| 42 | + mock-oauth2: |
| 43 | + image: ghcr.io/navikt/mock-oauth2-server:2.1.10 |
| 44 | + container_name: mock-oauth2 |
| 45 | + environment: |
| 46 | + - SERVER_PORT=9090 |
| 47 | + - JSON_CONFIG={"interactiveLogin":true,"httpServer":"NettyWrapper","tokenCallbacks":[{"issuerId":"default","tokenExpiry":3600,"requestMappings":[{"requestParam":"grant_type","match":"*","claims":{"sub":"testuser","email":"testuser@example.com","name":"Test User"}}]}]} |
| 48 | + ports: |
| 49 | + - "9090:9090" |
| 50 | + networks: |
| 51 | + - webapi-network |
| 52 | + |
| 53 | + webapi: |
| 54 | + build: |
| 55 | + context: ../.. |
| 56 | + dockerfile: Dockerfile |
| 57 | + container_name: webapi |
| 58 | + restart: on-failure:3 |
| 59 | + depends_on: |
| 60 | + postgres: |
| 61 | + condition: service_healthy |
| 62 | + cdm-db: |
| 63 | + condition: service_healthy |
| 64 | + mock-oauth2: |
| 65 | + condition: service_started |
| 66 | + environment: |
| 67 | + - SPRING_DATASOURCE_HIKARI_CONNECTIONTIMEOUT=60000 |
| 68 | + - SPRING_DATASOURCE_HIKARI_INITIALIZATIONFAILTIMEOUT=60000 |
| 69 | + - DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi |
| 70 | + - DATASOURCE_USERNAME=postgres |
| 71 | + - DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-postgres} |
| 72 | + - DATASOURCE_OHDSI_SCHEMA=webapi |
| 73 | + - SPRING_JPA_PROPERTIES_HIBERNATE_DEFAULT_SCHEMA=webapi |
| 74 | + - SPRING_BATCH_REPOSITORY_TABLEPREFIX=webapi.BATCH_ |
| 75 | + - SPRING_FLYWAY_URL=jdbc:postgresql://postgres:5432/ohdsi |
| 76 | + - SPRING_FLYWAY_USER=postgres |
| 77 | + - SPRING_FLYWAY_PASSWORD=${POSTGRES_PASSWORD:-postgres} |
| 78 | + - SPRING_FLYWAY_SCHEMAS=webapi |
| 79 | + - SPRING_FLYWAY_PLACEHOLDERS_OHDSISCHEMA=webapi |
| 80 | + - SECURITY_PROVIDER=AtlasRegularSecurity |
| 81 | + - SECURITY_AUTH_OPENID_ENABLED=true |
| 82 | + - SECURITY_AUTH_JDBC_ENABLED=true |
| 83 | + - SECURITY_AUTH_LDAP_ENABLED=false |
| 84 | + - SECURITY_AUTH_AD_ENABLED=false |
| 85 | + - SECURITY_AUTH_CAS_ENABLED=false |
| 86 | + - SECURITY_AUTH_WINDOWS_ENABLED=false |
| 87 | + - SECURITY_AUTH_KERBEROS_ENABLED=false |
| 88 | + - SECURITY_AUTH_GOOGLE_ENABLED=false |
| 89 | + - SECURITY_AUTH_FACEBOOK_ENABLED=false |
| 90 | + - SECURITY_AUTH_GITHUB_ENABLED=false |
| 91 | + - SECURITY_OID_CLIENTID=webapi-client |
| 92 | + - SECURITY_OID_APISECRET=${OIDC_CLIENT_SECRET:-webapi-secret} |
| 93 | + - SECURITY_OID_URL=http://mock-oauth2:9090/default/.well-known/openid-configuration |
| 94 | + - SECURITY_OID_EXTERNALURL=http://localhost:9090/default |
| 95 | + - SECURITY_OID_LOGOUTURL=http://localhost:9090/default/endsession |
| 96 | + - SECURITY_OID_EXTRASCOPES=profile email |
| 97 | + - SECURITY_OAUTH_CALLBACK_UI=http://localhost:18080/WebAPI/#/welcome |
| 98 | + - SECURITY_OAUTH_CALLBACK_API=http://localhost:18080/WebAPI/user/oauth/callback |
| 99 | + - SECURITY_OAUTH_CALLBACK_URLRESOLVER=query |
| 100 | + - SECURITY_DB_DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi |
| 101 | + - SECURITY_DB_DATASOURCE_DRIVERCLASSNAME=org.postgresql.Driver |
| 102 | + - SECURITY_DB_DATASOURCE_USERNAME=postgres |
| 103 | + - SECURITY_DB_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-postgres} |
| 104 | + - SECURITY_DB_DATASOURCE_SCHEMA=webapi |
| 105 | + - SECURITY_DB_DATASOURCE_AUTHENTICATIONQUERY=select password from webapi.users where lower(login) = lower(?) |
| 106 | + ports: |
| 107 | + - "18080:8080" |
| 108 | + healthcheck: |
| 109 | + test: ["CMD", "curl", "-f", "http://localhost:8080/WebAPI/info"] |
| 110 | + interval: 10s |
| 111 | + timeout: 5s |
| 112 | + retries: 30 |
| 113 | + start_period: 120s |
| 114 | + networks: |
| 115 | + - webapi-network |
| 116 | + |
| 117 | + db-setup: |
| 118 | + image: postgres:15-alpine |
| 119 | + container_name: db-setup |
| 120 | + depends_on: |
| 121 | + webapi: |
| 122 | + condition: service_healthy |
| 123 | + volumes: |
| 124 | + - ./setup-test-data.sql:/setup-test-data.sql:ro |
| 125 | + environment: |
| 126 | + PGPASSWORD: ${POSTGRES_PASSWORD:-postgres} |
| 127 | + command: > |
| 128 | + psql -h postgres -U postgres -d ohdsi -f /setup-test-data.sql |
| 129 | + networks: |
| 130 | + - webapi-network |
| 131 | + |
| 132 | + newman: |
| 133 | + image: postman/newman:6-alpine |
| 134 | + container_name: newman |
| 135 | + depends_on: |
| 136 | + webapi: |
| 137 | + condition: service_healthy |
| 138 | + db-setup: |
| 139 | + condition: service_completed_successfully |
| 140 | + volumes: |
| 141 | + - ./postman:/etc/newman |
| 142 | + - ./test-results:/results |
| 143 | + command: |
| 144 | + - run |
| 145 | + - /etc/newman/integration-tests.postman_collection.json |
| 146 | + - --environment |
| 147 | + - /etc/newman/integration-test-env.postman_environment.json |
| 148 | + - --reporters |
| 149 | + - cli,junit |
| 150 | + - --reporter-junit-export |
| 151 | + - /results/integration-test-results.xml |
| 152 | + - --timeout-request |
| 153 | + - "60000" |
| 154 | + networks: |
| 155 | + - webapi-network |
| 156 | + |
| 157 | +networks: |
| 158 | + webapi-network: |
| 159 | + driver: bridge |
0 commit comments