Golang production web application configuration

前端 未结 4 1660
感情败类
感情败类 2020-12-04 04:21

For those of you running Go backends in production:

What is your stack / configuration for running a Go web application?

I haven\'t seen much on this topic b

4条回答
  •  借酒劲吻你
    2020-12-04 05:13

    You can bind your binary to a socket to Internet domain privileged ports (port numbers less than 1024) using setcap

    setcap 'cap_net_bind_service=+ep' /path/to/binary

    1. This command needs to be escalated. sudo as necessary
    2. Every new version of your program will result in a new binary that will need to be reauthorized by setcap

    setcap documentation

    cap_net_bind_service documentation

提交回复
热议问题