abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
768 stars 315 forks source link

Building with gcloud plugin #135

Closed alexandzors closed 6 years ago

alexandzors commented 6 years ago

Currently at a loss on how to pass gcloud credentials to caddy after it is built. Here is my current compose file:

version: '3.3'
services:
  caddy:
    build:
      context: github.com/abiosoft/caddy-docker.git
        args:
          plugins: gcloud,geoip,nobots
    deploy:
      restart_policy:
        conditions: unless-stopped
    ports:
      - 81:80
      - 444:443
    volumes:
      - /home/docker/caddy:/etc/CaddyFile
      - /home/docker/caddy/certs:/root/.caddy
    environment:
      - "Not sure what to put here"=credentials
abiosoft commented 6 years ago

The plugin is googlecloud and it is only a dns plugin. All I can see with regards to env var config for it is https://godoc.org/github.com/xenolf/lego/providers/dns/gcloud#NewDNSProvider.

What are you trying to do?

alexandzors commented 6 years ago

Ah, was reading another other issues and saw something about googecloud being gcloud, though thats an easy fix. Anyway I was not entirely sure how to do the service account information or "pass" account credentials for the googlecloud dns plugin so that I can use it to obtain a wildcard certificate for my domain.

alexandzors commented 6 years ago

Okay nvm, apparently im blind. https://caddyserver.com/docs/automatic-https provides the environment variables I need for the googlecloud dns plugin

In my case its

GCE_DOMAIN
GOOGLE_APPLICATION_CREDENTIALS
abiosoft commented 6 years ago

Good to know you've found it. I guess I can close this now.