DEV Community

Discussion on: Best Practices When It Comes to Writing Docker Related Files

Collapse
 
david_j_eddy profile image
David J Eddy

"...Alphabetize each service's properties..." And her I was thinking I was the only person who did this.

"Exposing and Publishing on port 8000" Would it not make more sense to use 8080, the official HTTP alternate port?

Right on with your points about .dockerignore, to many times I have seen a .git inside a container. Makes me sad 'cause some places do not include .git in the server config ignore declaration. Thus accessing a projects .git via the HTTP is very possible. Couple this with the (always) bad practice of putting credentials into tracked files means the applications is inherently insecure.

Collapse
 
nickjj profile image
Nick Janetakis

You could choose 8080 if you want. I tend to reserve 8080 in the case where you might be running nginx or Apache behind a load balancer. You would typically listen on 8080 on those services and reserve 80/443 for your load balancer.

Collapse
 
david_j_eddy profile image
David J Eddy

Very reasonable. With micro-service style applications becoming more and more popular starting at a flat even 8000 gives us at least 80 before reaching 8080 :).

Thread Thread
 
nickjj profile image
Nick Janetakis • Edited

I went with 8000 because 8000 has the least amount of zeros to still be associated to port 80 and be above port 1024 to avoid permission issues.

Or the less scientific reason (and the real reason I went with it) is because when you pronounce it out loud you can pronounce it like Leonidas screams "This is Spartaaaaaaaaa!".

So now you have an excuse to scream "eight thousaaaaaaaaand!". It's the only thing I think of now whenever I read or write port 8000 and it makes me internally smile every time.

Thread Thread
 
david_j_eddy profile image
David J Eddy

Hahaha! Love it!