IP public in Docker-Compose.yml

Anybody have an example to affect PUBLIC IP to container in docker-compose.yml.
Container must be accessible whenever in internet
Thanks

Why would there be any difference in the mechanics of how to publish a public, private or local host ip port to a container port?

This is how you publish ports:

I want to access from other machine on internet?
But i found a solution : external_url
example to install gitlab with ip public
version: ‘3.8’

services:
web:
image: ‘gitlab/gitlab-ce:latest’
restart: always
hostname: ‘52.49.119.204’
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url ‘http://52.49.119.204
ports:
- ‘80:80’
volumes:
- ‘/srv/gitlab/config:/etc/gitlab’
- ‘/srv/gitlab/logs:/var/log/gitlab’
- ‘/srv/gitlab/data:/var/opt/gitlab’
networks:
- gitlab

networks:
gitlab:
name: gitlab-network