Skip to content

Commit

Permalink
fix(payments): fix local env docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-nicolas committed Sep 27, 2024
1 parent 615ddd8 commit 8f3d061
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
1 change: 1 addition & 0 deletions components/payments/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins
.DS_Store
.idea
vendor
Expand Down
1 change: 1 addition & 0 deletions components/payments/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ compile-plugins:
DO --pass-args core+GO_COMPILE --VERSION=$VERSION
WORKDIR /src
SAVE ARTIFACT /src/components/payments/internal/connectors/plugins/public/$c/cmd/main ./plugins/$c
SAVE ARTIFACT /src/components/payments/internal/connectors/plugins/public/$c/cmd/main AS LOCAL ./plugins/$c
END

compile:
Expand Down
47 changes: 42 additions & 5 deletions components/payments/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,47 @@ services:
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

temporal:
image: temporalio/auto-setup:1.25.0
depends_on:
postgres:
condition: service_healthy
environment:
DB: postgres12
DB_PORT: 5432
POSTGRES_USER: payments
POSTGRES_PWD: payments
POSTGRES_SEEDS: postgres
DYNAMIC_CONFIG_FILE_PATH: config/dynamicconfig/development-sql.yaml
ports:
- 7233:7233
volumes:
- ./local_env/postgres/temporal-sql.yaml:/etc/temporal/config/dynamicconfig/development-sql.yaml
temporal-admin-tools:
container_name: temporal-admin-tools
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CLI_ADDRESS=temporal:7233
image: temporalio/admin-tools:1.25.0-tctl-1.18.1-cli-1.0.0
stdin_open: true
tty: true
temporal-ui:
container_name: temporal-ui
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:2.26.2
ports:
- 8081:8080

payments:
image: golang:1.22.4-alpine3.19
command: go run ./ server
Expand All @@ -50,11 +86,12 @@ services:
- "8080:8080"
volumes:
- .:/app/components/payments
- ../../libs:/app/libs
working_dir: /app/components/payments
environment:
DEBUG: ${DEBUG:-"true"}
DEBUG: true
POSTGRES_URI: postgres://payments:payments@postgres:${POSTGRES_PORT:-5432}/payments?sslmode=disable
CONFIG_ENCRYPTION_KEY: mysuperencryptionkey

# TODO(polo): add temporal
TEMPORAL_ADDRESS: temporal:7233
PLUGIN_MAGIC_COOKIE: mysupercookie
PLUGIN_DIRECTORY_PATH: /app/components/payments/plugins
TEMPORAL_INIT_SEARCH_ATTRIBUTES: true
1 change: 1 addition & 0 deletions components/payments/local_env/postgres/init.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER ROLE payments SET search_path = public;
6 changes: 6 additions & 0 deletions components/payments/local_env/postgres/temporal-sql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
limit.maxIDLength:
- value: 255
constraints: {}
system.forceSearchAttributesCacheRefreshOnRead:
- value: true # Dev setup only. Please don't turn this on in production.
constraints: {}

0 comments on commit 8f3d061

Please sign in to comment.