mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
version: '3.8'
|
|
volumes:
|
|
postgres:
|
|
|
|
services:
|
|
postgres:
|
|
image: "postgres:14-alpine"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U payments -p ${POSTGRES_PORT:-5432}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
ports:
|
|
- "${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}"
|
|
environment:
|
|
POSTGRES_USER: "payments"
|
|
POSTGRES_PASSWORD: "payments"
|
|
POSTGRES_DB: "payments"
|
|
command: -p ${POSTGRES_PORT:-5432}
|
|
volumes:
|
|
- ./local_env/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
|
|
payments-migrate:
|
|
image: golang:1.22.4-alpine3.19
|
|
command: go run ./ migrate up
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- .:/app/components/payments
|
|
- ../../libs:/app/libs
|
|
working_dir: /app/components/payments
|
|
environment:
|
|
POSTGRES_URI: postgres://payments:payments@postgres:${POSTGRES_PORT:-5432}/payments?sslmode=disable
|
|
|
|
payments-api:
|
|
image: golang:1.22.4-alpine3.19
|
|
command: go run ./ api server
|
|
healthcheck:
|
|
test: [ "CMD", "curl", "-f", "http://127.0.0.1:8080/_healthcheck" ]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
payments-migrate:
|
|
condition: service_completed_successfully
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- .:/app/components/payments
|
|
- ../../libs:/app/libs
|
|
working_dir: /app/components/payments
|
|
environment:
|
|
DEBUG: ${DEBUG:-"true"}
|
|
POSTGRES_URI: postgres://payments:payments@postgres:${POSTGRES_PORT:-5432}/payments?sslmode=disable
|
|
CONFIG_ENCRYPTION_KEY: mysuperencryptionkey
|
|
|
|
payments-connectors:
|
|
image: golang:1.22.4-alpine3.19
|
|
command: go run ./ connectors server
|
|
healthcheck:
|
|
test: [ "CMD", "curl", "-f", "http://127.0.0.1:8081/_healthcheck" ]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
payments-migrate:
|
|
condition: service_completed_successfully
|
|
ports:
|
|
- "8081:8080"
|
|
volumes:
|
|
- .:/app/components/payments
|
|
- ../../libs:/app/libs
|
|
working_dir: /app/components/payments
|
|
environment:
|
|
DEBUG: ${DEBUG:-"true"}
|
|
POSTGRES_URI: postgres://payments:payments@postgres:${POSTGRES_PORT:-5432}/payments?sslmode=disable
|
|
CONFIG_ENCRYPTION_KEY: mysuperencryptionkey |