nomad

HCL and Docker files for Nomad deployments
git clone https://git.in0rdr.ch/nomad.git
Log | Files | Refs | Pull requests

README.md (1832B)


      1 My Heats Nginx Image
      2 --------------------
      3 
      4 Build instructions for Digital Ocean.
      5 
      6 Estimated Monthly
      7 - App Cost: $17.00 (2x$5 services + $7 PostgreSQL db)
      8 - Managed external db: $15
      9 - Droplet (incl. db, app services): $6
     10 
     11 https://www.digitalocean.com/pricing
     12 
     13 Build and push images
     14 ---------------------
     15 
     16 1 - Prepare build environment (variables are fixed during "vite build" step):
     17 
     18  export VITE_APP_DOC_TITLE='My title'
     19 
     20  # use NODE_ENV=prod to exclude the `devDependencies` (e.g., vite)
     21  export NODE_ENV=dev
     22 
     23 2 - Build frontend and push:
     24 
     25  # https://cloud.digitalocean.com/account/api/tokens
     26  podman login registry.digitalocean.com/myheats
     27 
     28  buildah bud --no-cache \
     29   --build-arg="VITE_APP_DOC_TITLE=$VITE_APP_DOC_TITLE" \
     30   --build-arg="NODE_ENV=$NODE_ENV" \
     31   --network=slirp4netns \
     32   -t registry.digitalocean.com/myheats/myheats:latest .
     33 
     34  buildah push registry.digitalocean.com/myheats/myheats:latest
     35 
     36 3 - Build backend/api and push:
     37 
     38  # https://code.in0rdr.ch/nomad/file/docker/docker-myheats-api/Dockerfile.html
     39 
     40  buildah bud --no-cache \
     41    --network=slirp4netns \
     42    -t registry.digitalocean.com/myheats/myheats:api .
     43 
     44  buildah push registry.digitalocean.com/myheats/myheats:api
     45 
     46 App service setup
     47 -----------------
     48 
     49 Use `digital-ocean-app.yaml` app spec to configure the app in Digital Ocean
     50 
     51 Droplet setup
     52 -------------
     53 
     54 Cheap and cheerful.
     55 
     56 1 - Create droplet
     57 
     58 2 - Create user
     59   - Configure ssh key and sshd agent
     60   - Configure sudoers
     61   - Install podman
     62   - Configure certbot
     63 
     64 3 - Clone repos (Podman and db schema)
     65 
     66  git clone --depth=1 https://git.in0rdr.ch/myheats.git myheats.git
     67  git clone --depth=1 https://git.in0rdr.ch/nomad.git nomad.git
     68  cd nomad.git/docker/docker-myheats-nginx/
     69 
     70 4 - Run podman services (frontend, api, db)
     71 
     72  sudo podman login registry.digitalocean.com/myheats
     73  sudo podman-compose up -d