Docker compose config problem

When I use docker compose config to create a single file, my db service ports also rendered but published one is a string variable therefore I get this:

services.db.ports.0.published must be a integer

Docker compose with the ports:

version: '3.6'
services:
  db:
    ports:
      - 4545:5432

Rendered result:

db:
    deploy:
      replicas: 1
      update_config:
        parallelism: 1
        order: stop-first
      placement:
        constraints:
          - node.labels.prod == true
    environment:
      POSTGRES_DB: mydb
      POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password
      POSTGRES_USER: postgres
    image: postgres:12
    networks:
      default: null
    ports:
      - mode: ingress
        target: 5432
        published: "4545" ------------------------> Making this an integer fix it
        protocol: tcp

When I remove the quotation marks it fixes this but how can I run the config command to not get this error?
is this the best way?

sed "s/published:.*/published: 4545/g"

Ther error message and the solution are pretty obvious.

What’s wrong with editing manually in the template you use to render your files?

Your sed command would replace ALL published ports to the specific port… I am not sure if this is realy what you want to do.

It is the part of a piplene step, I am using docker stack deploy at the end.

Your current approach to sort out the problems with your pipeline doesn’t seem to be effective. There are too many moving parts to recommend anything at this point.

As @rimelek wrote in another of your topics: reproduce the steps of the chain locally and inspect each of those steps.