180 lines
4.5 KiB
YAML
180 lines
4.5 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: cryptowallet-db
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: cryptowallet_devphase3
|
|
ports:
|
|
- '5432:5432'
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
vault:
|
|
image: hashicorp/vault:1.18
|
|
container_name: cryptowallet-vault
|
|
cap_add:
|
|
- IPC_LOCK
|
|
environment:
|
|
VAULT_ADDR: "http://127.0.0.1:8200"
|
|
ports:
|
|
- '8200:8200'
|
|
volumes:
|
|
- ./vault/vault.hcl:/vault/config/vault.hcl:ro
|
|
- vault_data:/vault/file
|
|
command: ["vault", "server", "-config=/vault/config/vault.hcl"]
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8200/v1/sys/seal-status > /dev/null 2>&1 || exit 0"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 5s
|
|
|
|
vault-init:
|
|
image: hashicorp/vault:1.18
|
|
container_name: cryptowallet-vault-init
|
|
entrypoint: /bin/sh
|
|
command: ["/scripts/vault-init.sh"]
|
|
volumes:
|
|
- ./scripts/vault-init.sh:/scripts/vault-init.sh:ro
|
|
- vault_data:/vault/file
|
|
environment:
|
|
VAULT_ADDR: http://vault:8200
|
|
depends_on:
|
|
vault:
|
|
condition: service_healthy
|
|
restart: "no"
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/api/Dockerfile
|
|
container_name: cryptowallet-api
|
|
ports:
|
|
- '3001:3001'
|
|
volumes:
|
|
- vault_data:/vault/file:ro
|
|
environment:
|
|
VAULT_ADDR: http://vault:8200
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_USER: postgres
|
|
DB_PASSWORD: postgres
|
|
DB_NAME: cryptowallet_devphase3
|
|
API_PORT: 3001
|
|
FRONTEND_URL: http://localhost:3000
|
|
RELAY_API_KEY: ${RELAY_API_KEY:-}
|
|
BITOK_JWKS_URL: http://bitok-auth:8000/.well-known/jwks.json
|
|
BITOK_ISSUER: auth-service
|
|
BITOK_AUDIENCE: wallet-service
|
|
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672/
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
vault-init:
|
|
condition: service_completed_successfully
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/web/Dockerfile
|
|
container_name: cryptowallet-web
|
|
ports:
|
|
- '3000:3000'
|
|
environment:
|
|
NEXT_PUBLIC_API_URL: http://localhost:3001
|
|
NEXT_PUBLIC_BITOK_URL: http://localhost:8000
|
|
depends_on:
|
|
- api
|
|
|
|
rabbitmq:
|
|
image: rabbitmq:3.13-management-alpine
|
|
container_name: cryptowallet-rabbitmq
|
|
ports:
|
|
- '5672:5672'
|
|
- '15672:15672'
|
|
environment:
|
|
RABBITMQ_DEFAULT_USER: guest
|
|
RABBITMQ_DEFAULT_PASS: guest
|
|
volumes:
|
|
- rabbitmq_data:/var/lib/rabbitmq
|
|
healthcheck:
|
|
test: ["CMD", "rabbitmq-diagnostics", "check_port_connectivity"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
keydb:
|
|
image: eqalpha/keydb
|
|
container_name: cryptowallet-keydb
|
|
ports:
|
|
- '6379:6379'
|
|
volumes:
|
|
- keydb_data:/data
|
|
command:
|
|
- keydb-server
|
|
- --requirepass
|
|
- keydb
|
|
- --appendonly
|
|
- "yes"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "-a", "keydb", "ping"]
|
|
interval: 5s
|
|
timeout: 2s
|
|
retries: 20
|
|
|
|
bitok-auth:
|
|
build:
|
|
context: ./BITOK
|
|
dockerfile: Dockerfile
|
|
container_name: cryptowallet-bitok
|
|
ports:
|
|
- '8000:8000'
|
|
volumes:
|
|
- vault_data:/vault/file:ro
|
|
- ./scripts/bitok-entrypoint.sh:/app/entrypoint.sh:ro
|
|
entrypoint: ["sh", "/app/entrypoint.sh"]
|
|
environment:
|
|
VAULT_ADDR: http://vault:8200
|
|
VAULT_MOUNT_POINT: secrets
|
|
REDIS_HOST: keydb
|
|
REDIS_PORT: 6379
|
|
REDIS_PASSWORD: keydb
|
|
JWT_AUDIENCE: "bitforce,wallet-service"
|
|
JWT_ISSUER: auth-service
|
|
CORS_ORIGINS: "http://localhost:3000,http://localhost:8000"
|
|
RABBIT_HOST: rabbitmq
|
|
RABBIT_PORT: 5672
|
|
RABBIT_USER: guest
|
|
RABBIT_PASSWORD: guest
|
|
RABBIT_EVENTS_EXCHANGE: bitok.events
|
|
RABBIT_EMAIL_CODE_QUEUE: email.verification_code
|
|
OUTBOX_POLL_INTERVAL_MS: 500
|
|
APP_HOST: "0.0.0.0"
|
|
APP_PORT: "8000"
|
|
APP_WORKERS: "1"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
vault-init:
|
|
condition: service_completed_successfully
|
|
keydb:
|
|
condition: service_healthy
|
|
rabbitmq:
|
|
condition: service_healthy
|
|
restart: "no"
|
|
|
|
volumes:
|
|
pgdata:
|
|
vault_data:
|
|
rabbitmq_data:
|
|
keydb_data:
|