0

I want to make https for my application which is running with docker container.

And I am following some tutorials and configuring nginx-proxy, letsencrypt, but I don't know how to get these files as volume.

You can see the bottom part "volumes" is empty. Where can I generate this config files? especially "vhost", "conf"

version: '2'

services:
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - conf:/etc/nginx/conf.d
      - vhost:/etc/nginx/vhost.d
      - dhparam:/etc/nginx/dhparam
      - certs:/etc/nginx/certs:ro
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - proxy
    restart: always

  letsencrypt:
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-proxy-le
    volumes_from:
      - nginx-proxy
    volumes:
      - certs:/etc/nginx/certs:rw
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: always

volumes:
  conf:
  vhost:
  dhparam:
  certs:

networks:
  proxy:
    external:
      name: nginx-proxy
potato
  • 203
  • 2
  • 15

1 Answers1

1

I hope you've found the answer. These volumes are automatically created when you run docker-compose up -d

You can see the volumes by running:

docker volume ls

Output should look like:

local     root_certs
local     root_confd
local     root_html
local     root_vhostd

Then you can inspect each volume to find the physical location:

docker inspect root_certs # check the "Mountpoint" line.