-
|
Hi, Trying to install as a service in a Swarm cluster, I'm not able to use ENV vars, but could use docker secrets. Is there a better way to solve this? Thanks. Thank you very much. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Sorry, the reply is late. In YAML, a hyphen - represents an item in a list. So, you are actually defining a list that contains only one string, the content of which is "POSTGRES_PASSWORD_FILE:/run/secrets/POSTGRES_PASSWORD". The following YAML should be working. networks:
databases:
external: true
secrets:
POSTGRES_PASSWORD:
file: .POSTGRES_PASSWORD
services:
pg17-v043:
image: tensorchord/vchord-postgres:pg17-v0.4.3
networks:
- databases
secrets:
- POSTGRES_PASSWORD
environment:
POSTGRES_PASSWORD_FILE: /run/secrets/POSTGRES_PASSWORD
volumes:
- /SwarmVolumes/data/postgresql:/var/lib/postgresql/data
- /SwarmVolumes/configs/postgresql:/etc/postgresql
deploy:
mode: replicated
replicas: 1 |
Beta Was this translation helpful? Give feedback.
Sorry, the reply is late. In YAML, a hyphen - represents an item in a list. So, you are actually defining a list that contains only one string, the content of which is "POSTGRES_PASSWORD_FILE:/run/secrets/POSTGRES_PASSWORD". The following YAML should be working.