Skip to content

ecoquants/server

Repository files navigation

server

Server software setup using Docker

2022-09-27 migrate to contabo

# brew install hudochenkov/sshpass/sshpass
sshpass -f '/Users/bbest/My Drive/private/contabo_root_pass.txt' ssh [email protected]

Transferred files via Cyberduck to host /share.

Setup Hardware

Setup ecoquants Droplet | Digital Ocean:

  • Image: Docker 19.03.12 on Ubuntu 20.04
  • Size: 4 vCPUs; 8GB / 160GB Disk; ($40/mo)
  • Region: SFO2
  • IPv4: 159.89.130.72

SSH using ~/.ssh/id_rsa.pub on Ben's Macbook Pro added to * Account > Settings > Security > SSH Keys | DigitalOcean

Shell into server

Setup domain

  • ecoquants.com | Google Domains with subdomains added under Custom resource records with:

  • Type: A, Data:159.89.130.72 and Name:

    • api
    • ckan
    • erddap
    • geo
    • rstudio
    • shiny
    • www-dev
    • drupal

Test Docker

docker run --name test-web -p 80:80 -d nginx

# confirm working
docker ps
curl http://localhost

Test: http://www-dev.ecoquants.com, http://159.89.130.72

docker stop test-web
docker rm test-web
docker ps -a

Docker with Caddy

# get latest docker-compose files
git clone https://github.com/ecoquants/server.git
cd server

# set environment variables: echo echo
echo 'PASSWORD=a*####*b' > .env

# setup local directories
mkdir /share
chmod -R 775 /share

# docker launch as daemon
docker-compose up -d

# To rebuild this image you must use:
#   docker-compose up --build

Rebuild caddy

eg after updating caddy/Caddyfile

C=caddy
docker stop $C
docker rm $C
docker-compose up -d
docker logs $C

2022-10-12 DNS funk

curl "https://cloudflare-dns.com/dns-query?name=bbnj.app&type=A" \
  -H "accept: application/dns-json"
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,"Question":[{"name":"bbnj.app","type":1}],"Authority":[{"name":"bbnj.app","type":6,"TTL":300,"data":"ns-cloud-b1.googledomains.com. cloud-dns-hostmaster.google.com. 4 21600 3600 259200 300"}]}