https://prefect.io logo
#prefect-server
Title
# prefect-server
c

Christopher Chong Tau Teng

11/03/2021, 6:34 AM
Hi, for the docker-compose.yaml generated by
prefect server config
, is there any way I can configure the UI service to start in other port than 8080 in the container? I don’t mean port mapping to docker host 8080:8080 here. I mean the port that UI service runs at in the container itself. Perhaps through some environment variables like UI_PORT?
a

Anna Geller

11/03/2021, 10:07 AM
not 100% sure if this is what you’re looking for, but you can try:
Copy code
prefect server config --ui-port 8081 # default is 8080
upvote 1
@Christopher Chong Tau Teng but I believe the result of this command will be: • host port: 8081 • container port: 8080 Why would you want to change the container port? it can cause issues, unless you configure other services to reflect that change
c

Christopher Chong Tau Teng

11/05/2021, 2:25 AM
@Anna Geller this command only maps host port to 8081 but still maintain container port at 8080; is there any way I can change the container port to some other ports, and map the other services accordingly?
a

Anna Geller

11/05/2021, 9:32 AM
not sure, perhaps you can if you dig deeper, but really why would you want to change it? do you run multiple services in a single container? the container port would only matter e.g. if you would be running 2 of the same services in a single container and want that one of them has a different than default port
c

Christopher Chong Tau Teng

11/05/2021, 10:03 AM
@Anna Geller that is because we have another container running at 8080, so we need to assign UI to a different port. Where can I dig deeper on this? I can’t find any info on Google how to specify a different port for UI in container P/S: we can’t use port mapping because our stack uses
network_mode=host
by default in all our container
a

Anna Geller

11/05/2021, 10:17 AM
But that’s totally fine. You can have this another container running with container port 8080 but with host port, say 8081. Then the Prefect’s UI container can have 8080 container port and 8080 host port. The container port and host port don’t need to use the same port number, you can have 8080:8080, 8080:8081. The container port doesn’t matter as long as only 1 service in a container is using that port. Only host ports cannot overlap
2 Views