-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
75 lines (71 loc) · 2.33 KB
/
docker-compose.yaml
File metadata and controls
75 lines (71 loc) · 2.33 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
65
66
67
68
69
70
71
72
73
74
75
# 只跑 postgres + redis,後端用 go run 或 binary 本機起
# GCP 部署:只需此檔 + vwap image,migration 會自動在 api 前執行
services:
postgres:
image: postgres:16
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: vwap_local
ports:
- "5432:5432"
redis:
image: redis:7
restart: always
ports:
- "6379:6379"
migration:
image: vwap:latest
restart: "no"
depends_on:
postgres:
condition: service_healthy
entrypoint: ["./migration"]
command: ["-once"]
environment:
ENV: local
APP_CONFIG_POSTGRESQL_HOST: postgres
APP_CONFIG_POSTGRESQL_PORT: "5432"
APP_CONFIG_POSTGRESQL_USER: postgres
APP_CONFIG_POSTGRESQL_PASSWORD: postgres
APP_CONFIG_POSTGRESQL_DATABASE: vwap_local
api:
image: vwap:latest
restart: always
depends_on:
migration:
condition: service_completed_successfully
redis:
condition: service_started
environment:
ENV: local
# HTTP
APP_CONFIG_HTTP_ADDR: "0.0.0.0:8080"
APP_CONFIG_HTTP_CORS_ENABLE: "true"
# PostgreSQL(用服務名,容器內可互相解析)
APP_CONFIG_POSTGRESQL_HOST: "postgres"
APP_CONFIG_POSTGRESQL_PORT: "5432"
APP_CONFIG_POSTGRESQL_USER: postgres
APP_CONFIG_POSTGRESQL_PASSWORD: postgres
APP_CONFIG_POSTGRESQL_DATABASE: vwap_local
# Redis
APP_CONFIG_REDIS_HOST: "redis"
APP_CONFIG_REDIS_PORT: "6379"
# Ethereum — defaults to Sepolia; override via .env for VTN or other networks
APP_CONFIG_ETHEREUM_RPC_URL: "${APP_CONFIG_ETHEREUM_RPC_URL:-https://ethereum-sepolia-rpc.publicnode.com}"
APP_CONFIG_ETHEREUM_CHAIN_ID: "${APP_CONFIG_ETHEREUM_CHAIN_ID:-11155111}"
APP_CONFIG_ETHEREUM_VWAP_RFQ_CONTRACT_ADDR: "${APP_CONFIG_ETHEREUM_VWAP_RFQ_CONTRACT_ADDR:-0x61A73573A14898E7031504555c841ea11E7FB07F}"
APP_CONFIG_ETHEREUM_INDEXER_START_BLOCK: "${APP_CONFIG_ETHEREUM_INDEXER_START_BLOCK:-0}"
APP_CONFIG_ETHEREUM_USE_MOCK: "${APP_CONFIG_ETHEREUM_USE_MOCK:-false}"
ports:
- "8080:8080"
volumes:
postgres_data: