Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 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
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ services:
- ".local/gateway/Caddyfile:/etc/caddy/Caddyfile"

ledger:
image: "ghcr.io/formancehq/ledger:v2.2.0"
git_url: https://github.com/Frame-Payments/ledger.git
git_branch: main
dockerfile_path: ./Dockerfile
command: server
healthcheck:
test: [ "CMD", "curl", "-f", "http://127.0.0.1:3068/_healthcheck" ]
interval: 10s
Expand All @@ -21,7 +24,8 @@ services:
postgres:
condition: service_healthy
environment:
POSTGRES_URI: "postgresql://formance:formance@postgres:${FORMANCE_POSTGRES_PORT:-5432}/ledger?sslmode=disable"
POSTGRES_URI: "postgresql://_env(DB_USER):_env(DB_PASSWORD)@_env(DB_HOST):_env(DB_PORT)/_env(DB_NAME)?sslmode=disable"


payments-migrate:
image: "ghcr.io/formancehq/payments:v3.0.1"
Expand Down
99 changes: 99 additions & 0 deletions service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
version: 2
services:
gateway:
git_url: https://github.com/Frame-Payments/ledger.git
git_branch: main
dockerfile_path: ./Dockerfile
ports:
- container: 80
http: 80
- container: 443
https: 443
volumes:
- .local/gateway/Caddyfile:/etc/caddy/Caddyfile
type: daemon_set

ledger:
git_url: https://github.com/Frame-Payments/ledger.git
git_branch: main
dockerfile_path: ./Dockerfile
command: ["/app/ledger", "server"]
healthcheck:
test: [ "CMD", "curl", "-f", "http://127.0.0.1:3068/_healthcheck" ]
interval: 10s
timeout: 5s
retries: 5
depends_on:
postgres:
condition: service_healthy
environment:
POSTGRES_URI: "postgresql://_env(DB_USER):_env(DB_PASSWORD)@_env(DB_HOST):_env(DB_PORT)/_env(DB_NAME)?sslmode=disable"


payments-migrate:
git_url: https://github.com/Frame-Payments/ledger.git
git_branch: main
dockerfile_path: ./Dockerfile
command: migrate up
depends_on:
postgres:
condition: service_healthy
environment:
POSTGRES_URI: "postgres://_env(DB_USER):_env(DB_PASSWORD)@_env(DB_HOST):_env(DB_PORT)/_env(DB_NAME)?sslmode=disable"

payments-api:
git_url: https://github.com/Frame-Payments/ledger.git
git_branch: main
dockerfile_path: ./Dockerfile
command: api server
healthcheck:
test: [ "CMD", "curl", "-f", "http://127.0.0.1:8080/_live" ]
interval: 10s
timeout: 5s
retries: 5
depends_on:
postgres:
condition: service_healthy
payments-migrate:
condition: service_completed_successfully
environment:
DEBUG: ${DEBUG:-"true"}
POSTGRES_URI: "postgres://_env(DB_USER):_env(DB_PASSWORD)@_env(DB_HOST):_env(DB_PORT)/_env(DB_NAME)?sslmode=disable"
CONFIG_ENCRYPTION_KEY: mysuperencryptionkey

payments-connectors:
git_url: https://github.com/Frame-Payments/ledger.git
git_branch: main
dockerfile_path: ./Dockerfile
command: connectors server
healthcheck:
test: [ "CMD", "curl", "-f", "http://127.0.0.1:8080/_live" ]
interval: 10s
timeout: 5s
retries: 5
depends_on:
postgres:
condition: service_healthy
payments-migrate:
condition: service_completed_successfully
environment:
DEBUG: ${DEBUG:-"true"}
POSTGRES_URI: "postgres://_env(DB_USER):_env(DB_PASSWORD)@_env(DB_HOST):_env(DB_PORT)/_env(DB_NAME)?sslmode=disable"
CONFIG_ENCRYPTION_KEY: mysuperencryptionkey

postgres:
image: postgres:13
ports:
- 5432
environment:
POSTGRES_USER: "_env(DB_USER)"
POSTGRES_PASSWORD: "_env(DB_PASSWORD)"
POSTGRES_DB: "_env(DB_NAME)"
volumes:
- postgres-data:/var/lib/postgresql/data

databases:
- postgresql

volumes:
postgres-data:
3 changes: 2 additions & 1 deletion tests/loadtesting/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ WORKDIR /k6
COPY . .
RUN yarn install
RUN yarn run build
ENTRYPOINT ["/usr/bin/k6"]
ENTRYPOINT ["/app/ledger"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

ENTRYPOINT references a non-existent path
The ENTRYPOINT is set to /app/ledger, but this Dockerfile never copies or builds a ledger binary into /app/ledger. At runtime, the container will fail with no such file or directory.

Please ensure that the ledger executable is produced (or copied) into /app/ledger. For example, if your build outputs ledger to dist/ledger, you might add:

 RUN yarn run build
+COPY dist/ledger /app/ledger
+RUN chmod +x /app/ledger

or adjust the ENTRYPOINT to point at the correct location of the built binary.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents (early access)
In tests/loadtesting/Dockerfile at line 12, the ENTRYPOINT is set to
/app/ledger, but the Dockerfile does not copy or build the ledger binary into
that path, causing runtime failure. Fix this by either adding a step in the
Dockerfile to copy the built ledger binary (e.g., from dist/ledger) into
/app/ledger or by changing the ENTRYPOINT to point to the actual location of the
ledger executable inside the container.

CMD ["run", "tests/benchmarks/scripts/benchs/ledger-v2.js"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify benchmark script path under /k6 working directory
You’ve set WORKDIR /k6, so CMD ["run", "tests/benchmarks/scripts/benchs/ledger-v2.js"] will resolve to /k6/tests/benchmarks/.... Confirm that this script path exists in your repo and is included in the image.

You can run locally to check before publishing:

or


🏁 Script executed:

rg --files-with-matches 'tests/benchmarks/scripts/benchs/ledger-v2.js'

Length of output: 99


🏁 Script executed:

docker build -t ledger-test . && docker run --rm ledger-test ls -R /k6/tests/benchmarks/scripts/benchs

Length of output: 128


🏁 Script executed:

#!/bin/bash
# Verify if ledger-v2.js exists anywhere in the repository
rg --files-with-matches 'ledger-v2.js'

Length of output: 94


Fix invalid benchmark script path in Dockerfile
The CMD in tests/loadtesting/Dockerfile is pointing at a non‐existent file—no tests/benchmarks/scripts/benchs/ledger-v2.js was found in the repo. Please update the path or add the missing script.

Locations to update:

  • tests/loadtesting/Dockerfile line 13
    - CMD ["run", "tests/benchmarks/scripts/benchs/ledger-v2.js"]
    + CMD ["run", "<correct/path>/ledger-v2.js"]

Next steps:

  • Verify where ledger-v2.js actually lives (or should be generated) and adjust the Docker CMD accordingly.
  • If the script is missing, add it under the intended directory (tests/benchmarks/scripts/benchs/) so it’s included in the image.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents (early access)
In tests/loadtesting/Dockerfile at line 13, the CMD references a benchmark
script path tests/benchmarks/scripts/benchs/ledger-v2.js that does not exist in
the image or repository. Verify the correct location of ledger-v2.js or where it
should be generated, then update the CMD to point to the valid path relative to
the WORKDIR /k6. If the script is missing, add it to
tests/benchmarks/scripts/benchs/ so it is included in the Docker image build.

Loading