Skip to content

Commit 6db5054

Browse files
using billing service for migrations and a default database DSN
1 parent 14888c6 commit 6db5054

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

framework/components/dockercompose/billing_platform_service/billing_platform_service.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"github.com/testcontainers/testcontainers-go/wait"
1414
)
1515

16+
const DefaultPostgresDSN = "postgres://postgres:postgres@postgres:5432/billing_platform"
17+
1618
type Output struct {
1719
BillingPlatformService *BillingPlatformServiceOutput
1820
Postgres *PostgresOutput
@@ -151,8 +153,8 @@ func New(in *Input) (*Output, error) {
151153
GRPCExternalURL: fmt.Sprintf("http://%s:%s", billingExternalHost, billingExternalPort.Port()),
152154
},
153155
Postgres: &PostgresOutput{
154-
155-
}
156+
DSN: DefaultPostgresDSN,
157+
},
156158
}
157159

158160
framework.L.Info().Msg("Billing Platform Service stack start")

framework/components/dockercompose/billing_platform_service/docker-compose.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
restart: on-failure
44
tty: true
55
container_name: billing-platform-service
6-
image: ${BILLING_PLATFORM_SERVICE_IMAGE:-}
6+
image: ${BILLING_PLATFORM_SERVICE_IMAGE:-billing-platform-service:local-cre}
77
command: ["grpc-service"]
88
depends_on:
99
postgres:
@@ -21,9 +21,9 @@ services:
2121
CREDIT_RESERVATION_SERVER_PORT: 2223
2222
WORKFLOW_OWNERSHIP_PROOF_SERVER_PORT: 2257
2323
WORKFLOW_OWNERSHIP_PROOF_SERVER_HOST: 0.0.0.0
24-
STREAMS_API_URL: ${STREAMS_API_URL}
25-
STREAMS_API_KEY: ${STREAMS_API_KEY}
26-
STREAMS_API_SECRET: ${STREAMS_API_SECRET}
24+
STREAMS_API_URL: ${STREAMS_API_URL:-}
25+
STREAMS_API_KEY: ${STREAMS_API_KEY:-}
26+
STREAMS_API_SECRET: ${STREAMS_API_SECRET:-}
2727
DB_HOST: postgres
2828
DB_PORT: 5432
2929
DB_NAME: billing_platform
@@ -54,21 +54,15 @@ services:
5454
- "5432:5432"
5555

5656
migrations:
57-
image: ${BILLING_PLATFORM_SERVICE_MIGRATION_IMAGE:-}
57+
image: ${BILLING_PLATFORM_SERVICE_IMAGE:-billing-platform-service:local-cre}
5858
container_name: db-migrations-billing-platform
5959
restart: on-failure
60+
command: ["db", "migrate", "--url=${DATABASE_URL}"]
6061
environment:
61-
DBMATE_NO_DUMP_SCHEMA: true
62-
DBMATE_WAIT: true
6362
DATABASE_URL: postgres://postgres:postgres@postgres:postgres/billing_platform
6463
networks:
6564
- backend
6665
depends_on:
6766
postgres:
6867
condition: service_healthy
69-
entrypoint:
70-
- dbmate
71-
- up
72-
- --
73-
- --url=${DATABASE_URL}
74-
- --migrations-dir=/db
68+

0 commit comments

Comments
 (0)