This repository has been archived by the owner on May 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
63 lines (61 loc) · 1.96 KB
/
docker-compose.yaml
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
version: '3.9'
services:
frontend:
build: .
image: '${REGISTRY:-ghcr.io}/echo-webkom/echo-web-frontend:${GITHUB_SHA:-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
# 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.}
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-very-secret-string-123}
backend:
image: '${REGISTRY:-ghcr.io}/echo-webkom/echo-web-backend:${TAG:-latest-prod}'
# 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
logging:
driver: 'none'
environment:
DATABASE_URL: postgres://postgres:password@database/postgres
# The 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.4 is the version Heroku uses.
image: postgres:13.4-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