Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to read from Docker secret files? #8

Open
EgidioCaprino opened this issue Dec 3, 2023 · 1 comment
Open

Is there a way to read from Docker secret files? #8

EgidioCaprino opened this issue Dec 3, 2023 · 1 comment

Comments

@EgidioCaprino
Copy link

Hi all,

Is there a way to read PORKBUN_API_KEY and PORKBUN_API_SECRET_KEY from secret files created by Docker?

@SinisterSpatula
Copy link

Yes, I do it like this:

docker-compose.yml

services:
  caddy:
    container_name: caddy
    build:
      context: ./
      target: caddy
    ports:
      - "80:80"
      - "443:443"
    environment:
      - PORKBUN_API_KEY=${PORKBUN_API_KEY}
      - PORKBUN_API_SECRET_KEY=${PORKBUN_API_SECRET_KEY}

.env file

PORKBUN_API_KEY="yourKeyHere"
PORKBUN_API_SECRET_KEY="youSecretKeyHere"

I place the .env file next to the compose file. It reads the env and uses the values from .env file within the compose file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants