forked from bacalhau-project/generic-dcn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
148 lines (144 loc) · 4.65 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: '3'
services:
router:
image: binocarlos/noxy:v6
restart: always
ports:
- ${PORT_NOXY:-80}:80
depends_on:
- postgres
- keycloak
- api
- frontend
environment:
- NOXY_DEFAULT_HOST=frontend
- NOXY_DEFAULT_PORT=${FRONTEND_INTERNAL_PORT:-8081}
- NOXY_DEFAULT_WS=1
- NOXY_API_FRONT=/api/v1
- NOXY_API_HOST=api
- NOXY_API_PORT=80
- NOXY_API_WS=1
- NOXY_KEYCLOAK_FRONT=/auth
- NOXY_KEYCLOAK_HOST=keycloak
- NOXY_KEYCLOAK_PORT=8080
- NOXY_GRADIO_FRONT=/gradio
- NOXY_GRADIO_HOST=gradio
- NOXY_GRADIO_PORT=7860
- NOXY_GRADIO_WS=1
networks:
- lilysaas
postgres:
image: postgres:12.13-alpine
restart: always
ports:
- 5432:5432
volumes:
- ${POSTGRES_DATA:-lilysaas-postgres-db}:/var/lib/postgresql/data
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${POSTGRES_ADMIN_PASSWORD:-postgres}
networks:
- lilysaas
keycloak:
image: quay.io/modeldynamics/keycloak:15.0.2-helix
restart: always
ports:
- 8085:8080
- 8443:8443
environment:
- KEYCLOAK_USER=admin
- KEYCLOAK_PASSWORD=${KEYCLOAK_ADMIN_PASSWORD:-oh-hallo-insecure-password}
- KC_PROXY=edge
- DB_VENDOR=h2
- KEYCLOAK_IMPORT=/imported/realm.json -Dkeycloak.profile.feature.upload_scripts=enabled -Dkeycloak.profile=preview
- KEYCLOAK_FRONTEND_URL=${KEYCLOAK_FRONTEND_URL:-https://app.lilypad.tech/auth/}
volumes:
- ./realm.json:/imported/realm.json
- ${KEYCLOAK_DATA:-lilysaas-keycloak-db}:/opt/jboss/keycloak/standalone/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 10s
retries: 3
start_period: 5s
networks:
- lilysaas
api:
build:
context: .
dockerfile: Dockerfile.api
restart: always
ports:
- 8084:80
environment:
- LOG_LEVEL=debug
- APP_URL=${SERVER_URL:-https://app.lilypad.tech}
- POSTGRES_HOST=postgres
- POSTGRES_DATABASE=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${POSTGRES_ADMIN_PASSWORD:-postgres}
- SERVER_URL=${SERVER_URL:-https://app.lilypad.tech}
- KEYCLOAK_URL=http://keycloak:8080/auth
- WEB3_RPC_URL=ws://testnet.lilypad.tech:8546
# this is an insecure (development) private key - will need to be changed in .env file for production
- WEB3_PRIVATE_KEY=${WEB3_PRIVATE_KEY:-0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba}
- SERVICE_SOLVER=${SERVICE_SOLVER:-0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC}
- SERVICE_MEDIATORS=${SERVICE_MEDIATORS:-0x90F79bf6EB2c4f870365E785982E1f101E93b906}
- WEB3_CONTROLLER_ADDRESS=${WEB3_CONTROLLER_ADDRESS:-0x59b670e9fA9D0A427751Af201D676719a970857b}
# this is an insecure development key - do not use in production!
- KEYCLOAK_TOKEN=${KEYCLOAK_TOKEN:-5ca0fc03-d625-456e-bca7-8e732309165f}
networks:
- lilysaas
entrypoint: ${API_ENTRYPOINT:-go run . saas-api}
volumes:
- ./go.mod:/app/go.mod
- ./go.sum:/app/go.sum
- ./cmd:/app/cmd
- ./pkg:/app/pkg
- ./main.go:/app/main.go
gradio:
ports:
- 7860:7860
build:
context: gradio
dockerfile: Dockerfile
restart: always
# TODO: in production, maybre remove --reload?
entrypoint: uvicorn main:app --reload --host 0.0.0.0 --port 7860
environment:
- SOLVER_URL=${SOLVER_URL:-http://172.17.0.1:8080}
networks:
- lilysaas
# uvicorn will auto-reload, or you can docker-compose restart gradio when
# changing the code
# (you'll still need to docker-compose build gradio when changing the
# requirements, or do things with exec/pip)
volumes:
- ./gradio:/app
frontend:
ports:
- 8081:${FRONTEND_INTERNAL_PORT:-8081}
build:
context: frontend
dockerfile: Dockerfile
# set FRONTEND_TARGET=deploy-frontend in .env to build production assets
target: ${FRONTEND_TARGET:-build-env}
restart: always
# let it be defined but not empty (no colon below), since an empty entrypoint means use the one from the Dockerfile
entrypoint: ${FRONTEND_ENTRYPOINT:-yarn run dev}
networks:
- lilysaas
volumes:
- ./frontend/package.json:/app/package.json
- ./frontend/src:/app/src
- ./frontend/assets:/app/assets
- ./frontend/index.html:/app/index.html
- ./frontend/tsconfig.json:/app/tsconfig.json
- ./frontend/vite.config.ts:/app/vite.config.ts
networks:
lilysaas:
driver: bridge
volumes:
lilysaas-keycloak-db:
lilysaas-postgres-db: