Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion completion/bash/itkdev-docker-compose-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _idc_completions()
fi

# Keep the suggestions in a local variable
local suggestions=($(compgen -W "dory:start dory:stop url open drush nfs:enable template:install template:update traefik:start traefik:stop traefik:open traefik:url mail:open mail:url mailhog:open mailhog:url sql:cli sql:connect sql:log sql:port sql:open xdebug xdebug3 hosts:insert self:update sync sync:db sync:files images:pull composer php version bin/console" -- "${COMP_WORDS[1]}"))
local suggestions=($(compgen -W "url open drush nfs:enable template:install template:update traefik:start traefik:stop traefik:open traefik:url mail:open mail:url mailhog:open mailhog:url sql:cli sql:connect sql:log sql:port sql:open xdebug xdebug3 hosts:insert self:update sync sync:db sync:files images:pull composer php version bin/console" -- "${COMP_WORDS[1]}"))

COMPREPLY=("${suggestions[@]}")

Expand Down
2 changes: 0 additions & 2 deletions completion/zsh/_itkdev-docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ _itkdev-docker-compose() {
case $state in
(command)
_values 'itkdev-docker-compose command' \
'dory\:start[Start reverse proxy]' \
'dory\:stop[Stop reverse proxy]' \
'url[Print url to site.]' \
'open[Open url in default browser.]' \
'drush[Run drush command.]' \
Expand Down
50 changes: 20 additions & 30 deletions scripts/itkdev-docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function self_update {
git checkout "$branch"
git pull

echo "${bold}Done.${normal}"
echo "${bold}Done. Please run traefik:pull to ensure you have the latest containers.${normal}"

echo
echo "Latest changes:"
Expand Down Expand Up @@ -187,12 +187,6 @@ Usage: itkdev-docker-compose command [command arguments]

Commands:

dory:start
Start dory reverse proxy

dory:stop
Stop dory reverse proxy

url [service [port]]
Print url to site or a service

Expand Down Expand Up @@ -264,16 +258,22 @@ Commands:
Update template installed in project.

traefik:start
Start træfik reverse proxy.
Start traefik reverse proxy.

traefik:stop
Stop træfik reverse proxy
Stop traefik reverse proxy

traefik:url
URL for the administrative UI for træfik.
URL for the administrative UI for traefik.

traefik:open
Open the administrative UI for træfik.
Open the administrative UI for traefik.

traefik:logs
See traefik logs

traefik:pull
Pull latest traefik & socket-proxy containers

mail:url
URL for the test mail web interface.
Expand Down Expand Up @@ -459,10 +459,6 @@ fi

# Allow traefik:start without existence of .env
if [[ "$#" -gt "0" && "$1" == "traefik:start" ]]; then
if [ "$(docker inspect -f '{{.State.Running}}' dory_dnsmasq 2>/dev/null)" == "true" ]; then
(>&2 echo "${bold}Dory reverse proxy should be stopped first. Run itkdev-docker-compose dory:stop.${normal}")
exit 22;
fi
docker network inspect frontend >/dev/null 2>&1 || docker network create --driver=bridge --attachable --internal=false frontend
$(cd ${script_dir}/../traefik/; docker compose up -d)
exit
Expand All @@ -474,19 +470,9 @@ if [[ "$#" -gt "0" && "$1" == "traefik:stop" ]]; then
exit
fi

# Allow dory:start without existence of .env
if [[ "$#" -gt "0" && "$1" == "dory:start" ]]; then
if [ "$(docker inspect -f '{{.State.Running}}' traefik 2>/dev/null)" == "true" ]; then
(>&2 echo "${bold}Traefik reverse proxy should be stopped first. Run itkdev-docker-compose traefik:stop.${normal}")
exit 22;
fi
dory up
exit
fi

# Allow dory:start without existence of .env
if [[ "$#" -gt "0" && "$1" == "dory:stop" ]]; then
dory down
# Allow traefik:pull without existence of .env
if [[ "$#" -gt "0" && "$1" == "traefik:pull" ]]; then
$(cd ${script_dir}/../traefik/; docker compose pull)
exit
fi

Expand Down Expand Up @@ -548,10 +534,9 @@ fi
# Check if revers proxy is running and print warning if not.
set +o errexit
is_treafik_running=$(docker inspect -f '{{.State.Running}}' traefik 2>/dev/null)
is_dory_running=$(docker inspect -f '{{.State.Running}}' dory_dnsmasq 2>/dev/null)
set -o errexit

if [ ! "$is_treafik_running" == "true" ] && [ ! "$is_dory_running" == "true" ]; then
if [ ! "$is_treafik_running" == "true" ]; then
(>&2 echo "${bold}Reverse proxy has not been started. Hostname will not be resolved to containers and not all commands will work correctly.${normal}")
fi

Expand Down Expand Up @@ -728,6 +713,11 @@ EOF
echo http://${url}:8080;
;;

traefik:logs)
echo "docker logs --tail 20 traefik"
docker logs --tail 20 traefik
;;

mail:url)
url="http://${COMPOSE_DOMAIN}:$(docker_compose port mail 8025 | cut -d: -f2)"
echo $url
Expand Down
4 changes: 2 additions & 2 deletions traefik/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ api:
disableDashboardAd: true

entryPoints:
http:
web:
address: ":80"
https:
websecure:
address: ":443"
http:
tls: {}
Expand Down