i need to generate a simple pretty standard docker compose content and update existing docker compose file with it. this yaml parser is looking good but couln't figure out the question mark thing it produces in its output.
here is my docker compose template file content:
version: "3.9"
name: "org"
services:
memory:
image: redis/redis-stack:7.2.0-v7
# ...
networks:
default:
name: org
external: true
im trying to add a new service to it:
import { readFile, writeFile } from 'node:fs/promises'
import { parseDocument } from 'yaml'
const doc = parseDocument(await readFile('./docker-compose.yml', 'utf8'))
doc.addIn(['services'], {
'my-service': {
'image': '${CONTAINER_CONN_STR}:${APP_VERSION:-latest}',
'ports': ['${GDEVOPS_APP_PORT}:${APP_PORT}']
}
})
await writeFile('./sample.yml', String(doc))
the output sample.yaml looks like this:
version: "3.9"
name: "org"
services:
memory:
image: redis/redis-stack:7.2.0-v7
# ...
? my-service:
image: ${CONTAINER_CONN_STR}:${APP_VERSION:-latest}
ports:
- ${GDEVOPS_APP_PORT}:${APP_PORT}
networks:
default:
name: org
external: true
how can i get rid of that question mark in front of my service?