Using secrets versus env variables with Podman #1063
-
Hello Community! Docker-compose override file: version: '3.4'
services:
netbox:
image: netbox:latest-plugins
ports:
- 8000:8080
environment:
REMOTE_AUTH_ENABLED: "True"
REMOTE_AUTH_BACKEND: "netbox.authentication.LDAPBackend"
AUTH_LDAP_SERVER_URI: "closed"
AUTH_LDAP_BIND_DN: "closed"
AUTH_LDAP_BIND_PASSWORD: "/run/secrets/auth_ldap_bind_password"
AUTH_LDAP_USER_SEARCH_BASEDN: "closed"
AUTH_LDAP_GROUP_SEARCH_BASEDN: "closed"
AUTH_LDAP_REQUIRE_GROUP_DN: "closed"
AUTH_LDAP_GROUP_TYPE: "NestedGroupOfNamesType"
AUTH_LDAP_IS_ADMIN_DN: "closed"
AUTH_LDAP_IS_SUPERUSER_DN: "Closed"
LDAP_IGNORE_CERT_ERRORS: "False"
DB_PASSWORD: "/run/secrets/db_password"
REDIS_CACHE_PASSWORD: "/run/secrets/redis_cache_password"
REDIS_PASSWORD: "/run/secrets/redis_password"
SECRET_KEY: "/run/secrets/secret_key"
secrets:
- auth_ldap_bind_password
- db_password
- redis_cache_password
- redis_password
- secret_key
build:
context: .
dockerfile: Dockerfile-Plugins
netbox-worker:
image: netbox:latest-plugins
environment:
DB_PASSWORD: "/run/secrets/db_password"
REDIS_CACHE_PASSWORD: "/run/secrets/redis_cache_password"
REDIS_PASSWORD: "/run/secrets/redis_password"
SECRET_KEY: "/run/secrets/secret_key"
build:
context: .
dockerfile: Dockerfile-Plugins
secrets:
- db_password
- redis_cache_password
- redis_password
- secret_key
netbox-housekeeping:
image: netbox:latest-plugins
environment:
DB_PASSWORD: "/run/secrets/db_password"
REDIS_CACHE_PASSWORD: "/run/secrets/redis_cache_password"
REDIS_PASSWORD: "/run/secrets/redis_password"
SECRET_KEY: "/run/secrets/secret_key"
build:
context: .
dockerfile: Dockerfile-Plugins
secrets:
- db_password
- redis_cache_password
- redis_password
- secret_key
postgres:
environment:
DB_PASSWORD: "/run/secrets/db_password"
restart: unless-stopped
secrets:
- db_password
redis:
environment:
REDIS_PASSWORD: "/run/secrets/redis_password"
restart: unless-stopped
secrets:
- redis_password
redis-cache:
environment:
REDIS_CACHE_PASSWORD: "/run/secrets/redis_cache_password"
restart: unless-stopped
secrets:
- redis_cache_password
secrets:
auth_ldap_bind_password:
external: true
db_password:
external: true
redis_cache_password:
external: true
redis_password:
external: true
secret_key:
external: true errors on logs:
Application is working fine when I add passwords in plain text to ENV files within env/ folder. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
I'm getting a similar outcome. I believe the function to consume secrets being used in The reason your stack is failing specifically on
|
Beta Was this translation helpful? Give feedback.
Hi @keeperAndy , that worked! Thanks a lot, really much apperciate your help
I'll summarize here your inputs and mark as answer if you dont mind
modify docker-compose override file with redis, redis-cache and postgres entries, add secrets and declare secrets, whole file looks like: