-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
132 lines (132 loc) · 3.88 KB
/
docker-compose.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
services:
nginx:
image: nginx
ports:
- "4444:80"
volumes:
- ./test_infra/test_files:/usr/share/nginx/html
motoserver:
image: motoserver/moto:4.1.0
ports:
- "5566:5566"
environment:
- MOTO_PORT=5566
- S3_IGNORE_SUBDOMAIN_BUCKETNAME=True
volumes:
- ./bin:/moto/bin
db:
image: postgres:14.2
healthcheck:
test: ['CMD', 'pg_isready', '-d', 'cryoet', '-U', 'postgres']
environment:
POSTGRES_INITDB_ARGS: --data-checksums
POSTGRES_DB: cryoet
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
# The postgres image declares a mounted volume at /var/lib/postgresql/data
# by default, which means that the data in that directory is difficult to
# snapshot and export. Here, we're telling Postgres to use this (non-mounted)
# directory as its storage location instead so it works with our db snapshot
# workflow.
PGDATA: /var/lib/cryoetdataportal/data
volumes:
- ./test_infra:/test_infra
ports:
- '5432:5432'
cryoet-api:
platform: linux/arm64
profiles: ["api", "apiv1"]
image: hasura-graphql
build:
context: ./api_server
dockerfile: Dockerfile
volumes:
- ./api_server/migrations:/hasura-migrations
- ./api_server/metadata:/hasura-metadata
healthcheck:
test: timeout 1s bash -c ':> /dev/tcp/127.0.0.1/8080' || exit 1
depends_on:
db:
condition: service_healthy
environment:
HASURA_GRAPHQL_ENABLE_CONSOLE: 'false'
HASURA_GRAPHQL_DATABASE_URL: postgresql://postgres:postgres@db:5432/cryoet
HASURA_GRAPHQL_ADMIN_SECRET: secret
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: anonymous
ports:
- '8080:8080'
hasura-console:
platform: linux/arm64
profiles: ["api", "apiv1"]
image: hasura-graphql
build:
context: ./api_server
dockerfile: Dockerfile
volumes:
- ./api_server:/app
healthcheck:
test: timeout 1s bash -c ':> /dev/tcp/127.0.0.1/9695' || exit 1
working_dir: /app
command: hasura-cli console
--no-browser
--endpoint http://cryoet-api:8080
--admin-secret secret
--address 0.0.0.0
--console-port 9695
--api-port 9693
--console-hge-endpoint http://localhost:8080
ports:
- '9695:9695'
- '9693:9693'
depends_on:
cryoet-api:
condition: service_healthy
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgres@db:5432/cryoet
cerbos:
image: ghcr.io/cerbos/cerbos:0.29.0
profiles: ["api", "apiv2"]
ports:
- "3692:3692"
- "3693:3693"
volumes:
- ./apiv2/cerbos:/var/policies/cerbos/
command:
["server", "--config", "/var/policies/cerbos/config.yaml"]
graphql-api:
image: "graphql-api"
profiles: ["api", "apiv2"]
build:
context: "apiv2"
dockerfile: "Dockerfile"
args:
- BUILDKIT_INLINE_CACHE=1
restart: always
ports:
- "9008:9008"
- "9009:9009"
environment:
- PYTHONPATH=.
- CERBOS_URL=http://cerbos:3692
- PLATFORMICS_DATABASE_HOST=db
- PLATFORMICS_DATABASE_PORT=5432
- PLATFORMICS_DATABASE_USER=postgres
- PLATFORMICS_DATABASE_PASSWORD=postgres
- PLATFORMICS_DATABASE_NAME=cryoetv2
- DEFAULT_UPLOAD_BUCKET=local-bucket
- DEFAULT_UPLOAD_PROTOCOL=s3
- OUTPUT_S3_PREFIX=platformics
- BOTO_ENDPOINT_URL=http://motoserver:5566
- AWS_REGION=us-west-2
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- DB_ECHO=true
# TODO - these are keypairs for testing only! Do not use in prod!!
- JWK_PUBLIC_KEY_FILE=/app/etc/public_key.pem
- JWK_PRIVATE_KEY_FILE=/app/etc/private_key.pem
volumes:
- ./apiv2:/app
command: ["/usr/local/bin/supervisord", "-c", "/app/etc/supervisord.conf"]
depends_on:
db:
condition: service_healthy