Skip to content

Add support for Docker Secrets by reading secrets files #8906

Answered by adas98012
horatiohe asked this question in Question
Discussion options

You must be logged in to vote

You can pass the env vars from a file (and specify the file in the docker compose).

Here is a sample docker compose file (see highlighted env_file section):

`
docker-compose.yml

version: '3.6'
services:
postgres:
image: postgres:12
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgrespassword
graphql-engine:
image: hasura/graphql-engine:v2.11.0
ports:
- "8080:8080"
depends_on:
- "postgres"
restart: always
env_file:
- ./test_env_vars.test

volumes:
db_data:

`
You can then add all your env vars in test_env_vars.test (used for illustration, please use a name suitable for your use):

`
test_env_vars.test
environment:
## postgres database to store H…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@horatiohe
Comment options

@inta
Comment options

Answer selected by adas98012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/deployment Related to deployment
3 participants
Converted from issue

This discussion was converted from issue #8896 on September 01, 2022 20:27.