Wingysam / Christmas-Community

Christmas lists for families
GNU Affero General Public License v3.0
234 stars 41 forks source link

Expose port 80 for the christmas-community service #32

Closed coalio closed 1 year ago

coalio commented 1 year ago

If the app is ran with docker-compose, the express server (port 80) should be open as well

Wingysam commented 1 year ago

Christmas Community by default listens on 3000, not 80. Does forwarding 80 have some benefit that I'm not understanding?

coalio commented 1 year ago

Yes, the express server starts at port 80 instead of 3000 if you build the service using the Dockerfile, as expressed in this line.

The environment variable will be ported to the docker-compose service, which means that this port will be used to start the express server. In any case, either the Dockerfile statement or this config key should be modified to be equivalent to each other.

Wingysam commented 1 year ago

I see! If the forward for 3000 doesn't do anything, can you remove that? Thanks!

coalio commented 1 year ago

I assumed you're more comfortable starting and previewing the application at port 3000, so I've modified the Dockerfile to start the Express server at 3000.

Additionally I noticed that the DB does not have a default port specified in the initial config, so I've included that too to match the Dockerfile.

Wingysam commented 1 year ago

I think it's better to keep it at 80 for backward-compatibility with existing deployments. The database should not be exposed by default because it doesn't have any security aside from not be accessible by network. Could you change it to listen on 80 and only forward 80? Thanks!

coalio commented 1 year ago

Sure, I'll do the changes after I'm back from work

coalio commented 1 year ago

@Wingysam done!

coalio commented 1 year ago

Done!

Wingysam commented 1 year ago

Thank you!