This repository was archived by the owner on May 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.cypress.yaml
More file actions
64 lines (62 loc) · 2.03 KB
/
docker-compose.cypress.yaml
File metadata and controls
64 lines (62 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: '3.9'
services:
frontend:
image: '${REGISTRY:-ghcr.io}/echo-webkom/echo-web-frontend:${FRONTEND_TAG:-latest}'
command: bash -c "yarn start & yarn cypress run --config video=false,screenshotOnRunFailure=false && kill $$!"
# Don't start tests before backend is up.
depends_on:
backend:
condition: service_healthy
links:
- backend
ports:
- '3000:3000'
environment:
BACKEND_URL: http://backend:8080
# Value of DEV doesn't matter, only that it's defined.
DEV: 'yes'
# Values from .env file.
SANITY_DATASET: ${SANITY_DATASET:?Must specify SANITY_DATASET in .env file or environment.}
ADMIN_KEY: ${ADMIN_KEY:?Must specify ADMIN_KEY in .env file or environment.}
backend:
build:
context: .
cache_from:
- '${REGISTRY:-ghcr.io}/echo-webkom/echo-web-backend:${BACKEND_TAG:-latest-dev}'
image: '${REGISTRY:-ghcr.io}/echo-webkom/echo-web-backend:${BACKEND_TAG:-latest-dev}'
# Don't start backend before database is up.
depends_on:
database:
condition: service_healthy
links:
- database
ports:
- '8080:8080'
# Check if backend is ready, and insert bedpres for testing.
healthcheck:
test: ["CMD-SHELL", "./scripts/submit_happening -t -x $$ADMIN_KEY || exit 1" ]
interval: 5s
timeout: 5s
retries: 5
environment:
DATABASE_URL: postgres://postgres:password@database/postgres
# Value of DEV doesn't matter, only that it's defined.
DEV: 'yes'
# Values from .env file
ADMIN_KEY: ${ADMIN_KEY:?Must specify ADMIN_KEY in .env file or environment.}
database:
# Postgres 13.6 is the version Heroku uses.
image: postgres:13.6-alpine
restart: always
ports:
- '5432:5432'
# Check if database is ready.
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres