Fixes #144 ## How to test 1. Go to https://scipro-supervisor-submit-to-examiner-date.branch.dsv.su.se 2. Log in as `einstein@example.com` 3. Open the project 4. See Galileo's date on the overview 5. Go to finishing up tab and see his date there as well 6. Go to Newtons tab and submit (it will stay in the unsubmitted view due to mocked APIs with fixed data) 7. Go to overview 8. See that Newtons submitted date is correctly shown as the moment you submitted ## Mocked APIs This pull request will in addition to fixing #144 also set up mocked APIs for the integrations with grading service and Daisy. To use those mocked APIs remove any outside configuration (in Tomcat or otherwise) for `service.grading.url` and `daisy.api.{url,username,password}`. To add new data to the mocked APIs see the YAML files in the `mock-api` directory. See [APImposter](https://gitea.dsv.su.se/DMC/apimposter) for more technical details how it works. Reviewed-on: #167 Reviewed-by: Tom Zhao <tom.zhao@dsv.su.se>
78 lines
2.2 KiB
YAML
78 lines
2.2 KiB
YAML
services:
|
|
scipro:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
oauth2:
|
|
condition: service_started
|
|
environment:
|
|
- JDBC_DATABASE_URL=jdbc:mariadb://db:3306/scipro
|
|
- JDBC_DATABASE_USERNAME=scipro
|
|
- JDBC_DATABASE_PASSWORD=scipro
|
|
- OAUTH2_ISSUER_URI=https://oauth2-${VHOST}
|
|
- OAUTH2_CLIENT_ID=scipro_client
|
|
- OAUTH2_CLIENT_SECRET=scipro_secret
|
|
- SERVICE_GRADING_URL=http://mock-apis:8080/gs/api/
|
|
- SERVICE_DAISY_URL=http://mock-apis:8080/daisy/
|
|
networks:
|
|
- traefik
|
|
- internal
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${VHOST}`)"
|
|
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls.certresolver=letsencrypt"
|
|
|
|
db:
|
|
image: mariadb:10.11
|
|
restart: unless-stopped
|
|
networks:
|
|
- internal
|
|
environment:
|
|
MARIADB_ROOT_PASSWORD: root
|
|
MARIADB_DATABASE: scipro
|
|
MARIADB_USER: scipro
|
|
MARIADB_PASSWORD: scipro
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect"]
|
|
start_period: 10s
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 6
|
|
|
|
oauth2:
|
|
build: https://gitea.dsv.su.se/DMC/oauth2-authorization-server.git#1d469c73468d00be5430dac01a7ab84f11ed471a
|
|
restart: unless-stopped
|
|
environment:
|
|
- CLIENT_ID=scipro_client
|
|
- CLIENT_SECRET=scipro_secret
|
|
- CLIENT_REDIRECT_URI=https://${VHOST}/login/oauth2/code/scipro
|
|
- CLIENT_SCOPES=openid offline_access grade:read grade:write
|
|
networks:
|
|
- traefik
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.oauth2-${COMPOSE_PROJECT_NAME}.rule=Host(`oauth2-${VHOST}`)"
|
|
- "traefik.http.routers.oauth2-${COMPOSE_PROJECT_NAME}.tls.certresolver=letsencrypt"
|
|
|
|
mock-apis:
|
|
build: https://gitea.dsv.su.se/DMC/apimposter.git#main
|
|
restart: unless-stopped
|
|
networks:
|
|
- internal
|
|
environment:
|
|
MOCK_BASE_PATH: / # HTTP base path for the mock server
|
|
MOCK_FILE_PATH: /mocks
|
|
volumes:
|
|
- ./mock-api:/mocks
|
|
|
|
networks:
|
|
traefik:
|
|
name: traefik
|
|
external: true
|
|
internal:
|
|
name: ${COMPOSE_PROJECT_NAME}_internal
|