diff --git a/_twig/docker-compose.yml/service/app.yml.twig b/_twig/docker-compose.yml/service/app.yml.twig index 281ed26..9c803c9 100644 --- a/_twig/docker-compose.yml/service/app.yml.twig +++ b/_twig/docker-compose.yml/service/app.yml.twig @@ -22,6 +22,10 @@ services: {% else %} target: nginx image: {{ @('services.app.image') }} +{% endif %} +{% if @('host.os') == 'linux' %} + extra_hosts: + - "host.docker.internal:host-gateway" {% endif %} labels: - traefik.backend={{ @('workspace.name') }} diff --git a/docker/image/app/Dockerfile.twig b/docker/image/app/Dockerfile.twig index 18aaaeb..67759d5 100644 --- a/docker/image/app/Dockerfile.twig +++ b/docker/image/app/Dockerfile.twig @@ -3,11 +3,6 @@ FROM console as node COPY .my127ws/docker/image/app/root-node / -RUN apt-get update && apt-get install --no-install-recommends -y iproute2 \ - && apt-get auto-remove -qq -y \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - FROM {{ @('services.app.build.from.nginx') }} as nginx RUN apk add --no-cache jq diff --git a/docker/image/app/root-node/entrypoint.sh b/docker/image/app/root-node/entrypoint.sh index 60ee5a3..ad83d37 100755 --- a/docker/image/app/root-node/entrypoint.sh +++ b/docker/image/app/root-node/entrypoint.sh @@ -1,24 +1,5 @@ #!/bin/bash -setup_app_networking() -{ - # make linux consistent with docker-for-mac - if [ "${HOST_OS_FAMILY}" = "linux" ]; then - DOCKER_INTERNAL_HOST="host.docker.internal" - if ! grep $DOCKER_INTERNAL_HOST /etc/hosts > /dev/null ; then - DOCKER_INTERNAL_IP=$(/usr/sbin/ip route|awk '/default/ { print $3 }') - echo -e "$DOCKER_INTERNAL_IP $DOCKER_INTERNAL_HOST" | tee -a /etc/hosts > /dev/null - fi - fi -} - -bootstrap() -{ - setup_app_networking -} - -bootstrap - if [ "${1:-}" == "sleep" ]; then "$@" else