I have two docker-compose.yml files and one works but the other with ‘command’ that supplies ssl=on does not.
docker-compose.yml – without commaond ssl – works
services:
postgres-example-pg-hba:
image: mybuild:1
secrets:
- pg_password
environment:
- POSTGRES_DB=mydb
- POSTGRES_USER_FILE=mysuperuser
- POSTGRES_PASSWORD_FILE=/run/secrets/pg_password
build:
context: .
ports:
- "5432:5432"
restart: unless-stopped
secrets:
pg_password:
external: true
docker-compose.yml – with command ssl=on – causes error
services:
postgres-example-pg-hba:
image: mybuild:1
secrets:
- pg_password
environment:
- POSTGRES_DB=mydb
- POSTGRES_USER=mysuperuser
- POSTGRES_PASSWORD_FILE=/run/secrets/pg_password
command:
-c ssl=on
-c ssl_cert_file=/temp/ssl/server.crt
-c ssl_key_file=/temp/ssl/server.key
-c ssl_ca_file=/temp/ssl/root.crt
build:
context: .
ports:
- "5432:5432"
restart: unless-stopped
secrets:
pg_password:
external: true
when I run the follwing commands:
- docker build -t mybuild:1 .
- docker stack deploy –compose-file=docker-compose.yml secret_test
I get error:
yaml: line 10: did not find expected key