From e3dd1e66c8bebd7b2a1041dc3f28bb33578b2473 Mon Sep 17 00:00:00 2001 From: ismay Date: Mon, 20 Mar 2023 11:10:25 +0100 Subject: [PATCH] ci(cypress): use pre-seeded image --- .github/workflows/dhis2-verify-app.yml | 2 +- docker-compose.yml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yml diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index b355cc931..04586d9e5 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -97,7 +97,7 @@ jobs: - name: End-to-End tests uses: cypress-io/github-action@v5 with: - start: npx --yes @dhis2/cli-cluster up 2.40 --channel dev --db-version 2.40 --seed, yarn start:nobrowser + start: docker compose up, yarn start:nobrowser wait-on: 'http://localhost:8080/dhis-web-commons/security/login.action, http://localhost:3000' wait-on-timeout: 600 record: true diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..280a4cf6c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3.8" + +services: + web: + image: dhis2/core:2.39.1 + ports: + - 127.0.0.1:8080:8080 # DHIS2 + volumes: + - ./dhis.conf:/opt/dhis2/dhis.conf:ro + depends_on: + db: + condition: service_healthy + + db: + image: radnov/dhis2-sl-db:2.39.1 + ports: + - 127.0.0.1:5432:5432 + healthcheck: + test: ["CMD-SHELL", "PGPASSWORD=dhis psql --no-password --quiet --username dhis postgres://127.0.0.1/dhis2 -p 5432 --command \"SELECT 'ok'\" > /dev/null"] + start_period: 30s + interval: 1s + timeout: 3s + retries: 5