The REST API service is exposed on port 8008 on the rest-api container, and also forwarded to port 8008 on the host:
rest-api:
image: sawtooth-rest-api:latest
container_name: sawtooth-rest-api-default
expose:
- 8008
ports:
- "8008:8008"
depends_on:
- validator
entrypoint: sawtooth-rest-api --connect tcp://validator:4004 --bind rest-api:8008
The service should therefore be accessible from another Docker container as http://rest-api:8008/blocks or from the host as http://127.0.0.1:8008/blocks via a web browser or curl. If it does not work, try changing the entrypoint command to use --bind 0.0.0.0:8008 as the last argument.