This is my Docker Compose file containing 4 api containers:
version: '3.4'
services:
api1.api:
image: ${DOCKER_REGISTRY-}api1
build:
context: .
dockerfile: Api1.Api/Dockerfile
networks:
- dev-network
ports:
- "62000:443"
- "62001:80"
api2.api:
image: ${DOCKER_REGISTRY-}api2
build:
context: .
dockerfile: Api2.Api/Dockerfile
networks:
- dev-network
ports:
- "62002:443"
- "62003:80"
api3.api:
image: ${DOCKER_REGISTRY-}api3
build:
context: .
dockerfile: Api3.Api/Dockerfile
networks:
- dev-network
ports:
- "62004:443"
- "62005:80"
api4.api:
image: ${DOCKER_REGISTRY-}api4
build:
context: .
dockerfile: Api4.Api/Dockerfile
networks:
- dev-network
ports:
- "62006:443"
- "62007:80"
networks:
dev-network:
name: dev-network
I have set the ports but when I run docker-compose up -d, the results are that either 1 or 2 of the apis will have the specified ports only. The rest will be randomly generated or even blank?
I have to manually restart that container before it generates a random port.
Am I missing a command or step? How can I get my docker-compose to follow the ports that have been set?
You may also like…
- Why fluentd loss most of it's log while using http output plugin (in similar timestamp)
- Java Mouse Listener – Can event type be detected inside of an event?
- flutter build ipa works locally, but not when run on github actions on the same machine
- CSS Imported by a Dependency
- Module '"rxjs"' has no exported member 'firstValueFrom'
- what use spring multiple handler websocket session service
- Failing to increment pair count correctly add_pairs Tideman CS50
- How can I get the average cost from a specific column from a table in R
- The theme system is not working for me and I'm not sure why
- Sorting multiple rows of un-sorted data based on text string – GSheets
- Tkinter RuntimeError: main thread is not in main loop when trying to insert item into listbox from different thread
- SwiftUI: Generating a continuous alphabetical list (from a-z then from aa, bb, cc, …, aaa, bbb, ccc)
- AWS Eventbridge rule trigger once all in-flight sqs messages are processed
- Avoid calling a method in a loop
- How to add a single value in datagridview with c#?
- MenuItem with onClick={popupState.close} in Material-ui V 5.0 how to execute a Link to open the component?
amazon-web-services android angular api arrays c# css dart dataframe django docker excel express firebase flutter html ios java javascript jquery json kotlin laravel linux list mongodb mysql node.js pandas php postgresql python python-3.x r react-native reactjs regex spring spring-boot sql sql-server string swift typescript vue.js