Skip to content

Commit

Permalink
xsnippet-web: "publish" the exposed port to the host
Browse files Browse the repository at this point in the history
"Publish" the exposed port to the host effectively configuring a DNAT
iptables rule. This is useful for us, becase we get real remote IPs
in nginx logs instead of Docker Swarm VIP one.

moby/moby#25526
https://docs.docker.com/engine/swarm/services/#publish-a-services-ports-directly-on-the-swarm-node

Closes #9
  • Loading branch information
malor committed Jan 10, 2018
1 parent 05270c8 commit abf4cb0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ansible/all-in-one/docker/stack.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ services:
condition: on-failure
depends_on:
- api
# "publish" the exposed port to the host effectively configuring a DNAT iptables rule. This
# is useful for us, becase we get real remote IPs in nginx logs instead of Docker Swarm VIP
ports:
- "80:80"
- target: 80
published: 80
protocol: tcp
mode: host
networks:
- default
networks:
Expand Down

0 comments on commit abf4cb0

Please sign in to comment.