How to expose a container port outside of docker/container using docker-compose?
If you want to actually map the port you should use
ivms:
build: .
container_name: ivms
command: bash bashes/createDB.sh
volumes:
- .:/code
ports:
- "8010:8010"
- "9001:9001" # now you can access them locally
warning you are using the same port for these two services ivms and nginx
The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. You can specify whether the port listens on TCP or UDP, and the default is TCP if the protocol is not specified.
The EXPOSE instruction does not actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published. -Docker Docs