Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docker compose #501

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 21 additions & 38 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@ version: "3.6"

services:
w3bapp:
image: ${WS_BACKEND_IMAGE:-ghcr.io/machinefi/w3bstream:main}
# image: ${WS_BACKEND_IMAGE:-ghcr.io/machinefi/w3bstream:main}
build: .
depends_on:
- "postgres"
- "mqtt_server"
container_name: w3bstream
platform: linux/x86_64
working_dir: /w3bstream
restart: always
ports:
- "8888:8888"
- "8889:8889"
environment:
SRV_APPLET_MGR__EthClient_Endpoints: '{"4689": "https://babel-api.mainnet.iotex.io", "4690": "https://babel-api.testnet.iotex.io", "1": "https://ethereum.iotex.one/v1/mainnet", "5": "https://ethereum.iotex.one/v1/goerli", "137": "https://polygon-rpc.com", "80001": "https://mumbai.polygonscan.com/"}'
SRV_APPLET_MGR__Jwt_ExpIn: ${JWT_EXPIN:-1h}
SRV_APPLET_MGR__Jwt_ExpIn: 1h
SRV_APPLET_MGR__Jwt_Issuer: ${JWT_ISSUER:-w3bstream}
SRV_APPLET_MGR__Jwt_SignKey: ${JWT_SIGN_KEY:-xxxx}
SRV_APPLET_MGR__Postgres_Master: postgresql://${POSTGRES_USER:-w3badmin}:${POSTGRES_PASSWORD:-PaSsW0Rd}@postgres:5432/${POSTGRES_DB:-w3bstream}?sslmode=disable
SRV_APPLET_MGR__MonitorDB_Master: postgresql://${POSTGRES_USER:-w3badmin}:${POSTGRES_PASSWORD:-PaSsW0Rd}@postgres:5432/${POSTGRES_DB:-w3bstream}?sslmode=disable
SRV_APPLET_MGR__WasmDB_Master: postgresql://${POSTGRES_USER:-w3badmin}:${POSTGRES_PASSWORD:-PaSsW0Rd}@postgres:5432/${POSTGRES_DB:-w3bstream}?sslmode=disable
SRV_APPLET_MGR__ServerEvent_Debug: "true"
SRV_APPLET_MGR__ServerEvent_HealthCheck: http://:8889/
SRV_APPLET_MGR__ServerEvent_Port: "8889"
SRV_APPLET_MGR__ServerEvent_Spec: ./swagger.json
SRV_APPLET_MGR__MqttBroker_Server: mqtt://mqtt_server:1883
SRV_APPLET_MGR__Server_Port: "8888"
volumes:
- ${WS_WORKING_DIR:-.}/asserts:/w3bstream/asserts
- w3bstream_assets:/w3bstream/asserts

mqtt_server:
image: eclipse-mosquitto:1.6.15
Expand All @@ -30,50 +38,21 @@ services:
ports:
- "1883:1883"
volumes:
- ${WS_WORKING_DIR:-.}/mqtt:/mosquitto/data
- mqtt:/mosquitto/data

postgres:
image: postgres:13
restart: always
command:
[
"postgres",
"-cshared_preload_libraries=pg_stat_statements"
]
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
environment:
POSTGRES_USER: ${POSTGRES_USER:-w3badmin}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-PaSsW0Rd}
POSTGRES_DB: ${POSTGRES_DB:-w3bstream}
volumes:
- ${WS_WORKING_DIR:-.}/postgres:/var/lib/postgresql/data
- postgres:/var/lib/postgresql/data
ports:
- "5432:5432"

redis:
image: 'redis:6.2'
restart: always
volumes:
- ${WS_WORKING_DIR:-.}/redisdb:/data
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-w3bredispasS}
command: redis-server --requirepass ${REDIS_PASSWORD:-w3bredispasS}
ports:
- '6379:6379'

graphql-engine:
image: hasura/graphql-engine:v2.15.2
depends_on:
- "postgres"
restart: always
ports:
- "8080:8080"
environment:
HASURA_GRAPHQL_METADATA_DATABASE_URL: postgresql://${POSTGRES_USER:-w3badmin}:${POSTGRES_PASSWORD:-PaSsW0Rd}@postgres:5432/${POSTGRES_DB:-w3bstream}
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_DEV_MODE: "true"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ADMIN_SECRET: ${ADMIN_SECRET:-w3baAdmiNsecrEtkey}

prometheus:
image: imoocc/prometheus:latest
depends_on:
Expand All @@ -83,6 +62,10 @@ services:
container_name: prometheus
restart: always
volumes:
- ${WS_WORKING_DIR:-.}/prometheus:/prometheus
ports:
- "9090:9090"
- prometheus:/prometheus

volumes:
mqtt:
postgres:
w3bstream_assets:
prometheus: