diff --git a/.env b/.env index ee5376a..ca3dde6 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ LOCAL_DOMAIN=docker.local -SUB_DOMAINS= +SUB_DOMAINS=*.env.docker.local \ No newline at end of file diff --git a/Makefile b/Makefile index f628295..7bf9079 100644 --- a/Makefile +++ b/Makefile @@ -35,13 +35,15 @@ generate_certificate: ## Generate a trusted certificate for local domain flesch/mkcert:latest \ mkcert -key-file ${LOCAL_DOMAIN}.key -cert-file ${LOCAL_DOMAIN}.crt *.${LOCAL_DOMAIN} ${SUB_DOMAINS} \ ; \ - sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ${PWD}/certs/rootCA.pem \ + sudo cp ${PWD}/certs/rootCA.pem /usr/local/share/ca-certificates/rootCA.pem && \ + sudo cp ${PWD}/certs/${LOCAL_DOMAIN}.crt /usr/local/share/ca-certificates/${LOCAL_DOMAIN}.crt && \ + sudo update-ca-certificates \ ; remove_certificate: ## Remove certificate generated for local domain @rm ${PWD}/certs/${LOCAL_DOMAIN}.key && \ rm ${PWD}/certs/${LOCAL_DOMAIN}.crt && \ - sudo security remove-trusted-cert -d ${PWD}/certs/rootCA.pem && \ + sudo update-ca-certificates --fresh && \ rm ${PWD}/certs/rootCA-key.pem && \ rm ${PWD}/certs/rootCA.pem \ ; @@ -69,4 +71,4 @@ terminal-dnsmasq-ext: ## Enter in dnsmasq for host terminal @docker exec -it dnsmasq-ext /bin/sh; terminal-dnsmasq-int: ## Enter in dnsmasq for containers terminal - @docker exec -it dnsmasq-int /bin/sh; + @docker exec -it dnsmasq-int /bin/sh; \ No newline at end of file diff --git a/README.md b/README.md index 53dd2c8..d487dbf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Docker dev routing +> ⚠️ For Windows +> +> Use the git bash terminal with administrator rights to use makeFile commands + + > This project is a Docker stack handling routing to containers during development. When you come to work with docker locally, you can expose your containers on a given host ports, or eventually, you bind them to an url, and with a solution like jwilder/nginx-proxy, you achieve that goal pretty easily. But, because there is always a but, you have to update your /etc/hosts. And if you want your containers to communicate through their respective url, you will have to bind them (for example with option `--link my-container-name:my-freaky-url.test`). Furthermore, this linking makes them now codependant, and you can not run one without the other. diff --git a/docker-compose.yml b/docker-compose.yml index c6f1797..522da4d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,11 +10,11 @@ services: ipv4_address: 172.25.0.255 ports: - 80:80 - - 443:443 +# - 443:443 volumes: - ./nginx-proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro - /var/run/docker.sock:/tmp/docker.sock:ro - - ./certs:/etc/nginx/certs:ro + #- ./certs:/etc/nginx/certs:ro restart: unless-stopped # Dnsmasq for host dnsmasq-ext: @@ -38,6 +38,8 @@ services: restart: unless-stopped networks: + app_subnet: + external: false default: name: common driver: bridge