- Use camelCase for variable name.
- Use "Insert" in repository only, don't use "Insert" outside repository folder.
- Use "Find" in repository only, don't use "Find" outside repository folder.
- Don't use pointer if you don't want to modify it.
- Create server
- Update server
sudo apt-get update
sudo apt-get upgrade
# if unattended-upgrades error run code below
sudo nano /etc/apt/apt.conf.d/20auto-upgrades
ps aux | grep -i apt
sudo dpkg-reconfigure unattended-upgrades
sudo kill <PID>
- Install docker, link
sudo apt-get docker-compose
- Prepare file config (nginx, .pem, docker-compose)
mkdir nginx-conf
nano nginx-conf/nginx.conf
# and copy from ./nginx_1.conf
mkdir dhparam
sudo openssl dhparam -out ./dhparam/dhparam-2048.pem 2048
nano docker-compose.yml
# and copy from ./docker-compose.yml
- run docker compose with
docker-compose up -d
- check logs:
docker-compose logs certbot
, we will see "Successfully received certificate." - rm nginx-conf/nginx.conf
- nano nginx-conf/nginx.conf, copy from nginx_2.conf
- docker-compose stop server_proxy
- docker-compose up -d --force-recreate --no-deps webhook
- When you facing error
error parsing uri: lookup staging.123123.mongodb.net on 172.20.10.1:53: cannot unmarshal DNS message
try to edit /etc/resolv.conf with 8.8.8.8
$ docker run --rm -p 8000:8000 havus/go-webhook-server:1.0-rc
Url: docker.io/havus/webhook-nginx
export $(cat .env | grep CR_PAT=) ./build_push_image.sh
- https://stackoverflow.com/questions/23542989/pointers-vs-values-in-parameters-and-return-values
- https://www.digitalocean.com/community/tutorials/how-to-secure-a-containerized-node-js-application-with-nginx-let-s-encrypt-and-docker-compose
- https://stackoverflow.com/questions/62229938/gobwas-ws-clean-conn-close
- https://stackoverflow.com/questions/60541611/mongodb-dump-fails-with-cannot-unmarshal-dns-message
- https://medium.com/free-code-camp/million-websockets-and-go-cc58418460bb
- https://stackoverflow.com/questions/35479041/how-to-convert-iso-8601-time-in-golang