Path: redb/redb.Templates/templates/route-xml/redb-route-as2/deploy/docker-compose.openas2.yml Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Templates/templates/route-xml/redb-route-as2/deploy/docker-compose.openas2.yml ---- # A local AS2 exchange: the module on a Tsak worker, OpenAS2 as its trading partner. A test stand with test keys made # on the spot, not a deployment. # # From the project folder (PowerShell or a POSIX shell alike): # dotnet build -p:PackRouteOnBuild=true -p:Version=1.0.0 # -> pkg/routemodule-1.0.0.tpkg # cp deploy/.env.example deploy/.env # then set AS2_KEY_PASSWORD # docker compose -f deploy/docker-compose.openas2.yml up -d # # certs runs first and once: keytool writes the module's key pair to deploy/keys, and OpenAS2's configuration to # deploy/openas2/config (the image's own template, partnerships.xml of this folder, a keystore with OpenAS2's key pair # and the module's certificate); it leaves them alone when they are there. The module sends to http://openas2:10080, # OpenAS2 sends to http://module:4080/as2/inbound; both stay inside the compose network. # OpenAS2 -> module: put a file into deploy/openas2/data/outbox/modulectx. name: modulectx-as2 services: certs: image: greicodex/openas2:4.9.0 environment: - AS2_KEY_PASSWORD=${AS2_KEY_PASSWORD:?AS2_KEY_PASSWORD required, see deploy/.env.example} volumes: - ./keys:/keys - ./openas2/config:/openas2-config - ./openas2/partnerships.xml:/partnerships.xml:ro # Test key pairs, RSA 2048, two years. The module: PKCS#12 with AS2_KEY_PASSWORD. OpenAS2: as2_certs.p12 with the # password its config.xml expects (testas2), holding its key pair and the module's certificate. entrypoint: ["sh", "-ec"] command: - | if [ -f /keys/module.p12 ] && [ -f /openas2-config/as2_certs.p12 ]; then echo "keys present"; exit 0; fi rm -rf /keys/module.p12 /keys/module.crt /keys/openas2.crt /openas2-config/* cp -r /opt/openas2/config_template/. /openas2-config/ cp /partnerships.xml /openas2-config/partnerships.xml rm -f /openas2-config/as2_certs.p12 keytool -genkeypair -alias module -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -validity 730 \ -dname "CN=module.example, O=Test only" \ -keystore /keys/module.p12 -storetype PKCS12 -storepass "$$AS2_KEY_PASSWORD" keytool -exportcert -rfc -alias module -keystore /keys/module.p12 -storetype PKCS12 \ -storepass "$$AS2_KEY_PASSWORD" -file /keys/module.crt keytool -genkeypair -alias openas2 -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -validity 730 \ -dname "CN=openas2.example, O=Test only" \ -keystore /openas2-config/as2_certs.p12 -storetype PKCS12 -storepass testas2 keytool -exportcert -rfc -alias openas2 -keystore /openas2-config/as2_certs.p12 -storetype PKCS12 \ -storepass testas2 -file /keys/openas2.crt keytool -importcert -noprompt -alias module -file /keys/module.crt \ -keystore /openas2-config/as2_certs.p12 -storetype PKCS12 -storepass testas2 chmod -R a+rwX /keys /openas2-config echo "keys written" openas2: image: greicodex/openas2:4.9.0 depends_on: certs: condition: service_completed_successfully volumes: - ./openas2/config:/opt/openas2/config - ./openas2/data:/opt/openas2/data module: image: ghcr.io/redbase-app/redb-tsak-worker:${TSAK_VERSION:-4.8.0-net10} depends_on: certs: condition: service_completed_successfully ports: - "127.0.0.1:4080:4080" # the AS2 receiver, for a partner on this machine environment: - Tsak__Modules__AssemblyPaths__0=/app/modules - Tsak__Cluster__ApiEndpoint=http://module:9090 # The module's context: the Override layer, which wins over every other layer of its configuration. - Tsak__Contexts__modulectx__Override__as2.keyFile=/app/keys/module.p12 - Tsak__Contexts__modulectx__Override__as2.keyPassword=${AS2_KEY_PASSWORD:?AS2_KEY_PASSWORD required, see deploy/.env.example} - Tsak__Contexts__modulectx__Override__as2.partnerCertificateFile=/app/keys/openas2.crt - Tsak__Contexts__modulectx__Override__as2.partnerUrl=http://openas2:10080 volumes: - ../pkg:/app/modules - ./keys:/app/keys:ro