When you create your service you need to use the `--publish` option.
E.g.:
docker service create --detach=true --replicas 3 --publish 80:80 --name httpd httpd
Now port 80 is exposed to the main network. Usefully, _every_ server in the swarm publishes port 80 and will do an internal redirect to wherever the container is actually running.
Similarly, if you use a stack then you use the `ports` option. E.g.:
services:
web:
image: httpd
ports:
- 80:80