Skip to content

Commit

Permalink
Use Docker embedded DNS server at 127.0.0.11 if running locally
Browse files Browse the repository at this point in the history
  • Loading branch information
zhelezovartem committed Aug 11, 2022
1 parent 09d1705 commit dbf996b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Expand Up @@ -18,6 +18,4 @@ COPY ports.k8s.env /docker-entrypoint.d
COPY ports.ecs.env /docker-entrypoint.d
COPY template-port-env-subst.sh /docker-entrypoint.d

RUN apt-get update && apt-get install -y dnsmasq

COPY gzip.conf /etc/nginx/conf.d/gzip.conf
3 changes: 2 additions & 1 deletion nginx.conf.template
Expand Up @@ -10,7 +10,8 @@ server {
listen ${CYBER_DOJO_NGINX_PORT};
server_name localhost;

# If using local DNS server 127.0.0.1, dnsmasq need to be installed on the node
# Use Docker embedded DNS server at 127.0.0.11 if running locally
# https://stackoverflow.com/questions/35744650/docker-network-nginx-resolver
resolver ${NGINX_RESOLVER_IP};

# Path for static files
Expand Down
2 changes: 1 addition & 1 deletion ports.docker.env
Expand Up @@ -21,4 +21,4 @@ CYBER_DOJO_RUNNER_HOSTNAME=runner
CYBER_DOJO_SAVER_HOSTNAME=saver
CYBER_DOJO_SHAS_HOSTNAME=shas
CYBER_DOJO_WEB_HOSTNAME=web
NGINX_RESOLVER_IP=127.0.0.1
NGINX_RESOLVER_IP=127.0.0.11
2 changes: 1 addition & 1 deletion ports.k8s.env
Expand Up @@ -21,4 +21,4 @@ CYBER_DOJO_RUNNER_HOSTNAME=runner
CYBER_DOJO_SAVER_HOSTNAME=saver
CYBER_DOJO_SHAS_HOSTNAME=shas
CYBER_DOJO_WEB_HOSTNAME=web
NGINX_RESOLVER_IP=127.0.0.1
NGINX_RESOLVER_IP=127.0.0.11

0 comments on commit dbf996b

Please sign in to comment.