OpenVAA / voting-advice-application

An open-source platform for creating Voting Advice Applications (VAAs)
https://openvaa.org/en
GNU General Public License v3.0
10 stars 0 forks source link

docs: add docs for deploying in Render #506

Closed kaljarv closed 1 week ago

kaljarv commented 6 months ago

Early draft:

Render

  1. Create Postgres 16 DB
    1. Copy addresses and usernames and pwds for Backend Envs
  2. Create Backend Service
    1. New Web Service
    2. Link to Github
    3. Select Branch
    4. Add path to Advanced/Dockerfile Path: ./backend/vaa-strapi/Dockerfile
    5. Add ENV from .env
    6. Copy ENV variables from Demo
    7. Udate database and frontend url ENVs
    8. You probably want to turn off Automatic Deploy from settings
    9. Make sure the instance has enough memory for Strapi
  3. Create Frontend service
    1. New Web Service
    2. Link to Github
    3. Select Branch
    4. Add path to Advanced/Dockerfile Path: ./frontend/Dockerfile
    5. Copy ENV variables from Demo
    6. Udate database and frontend url ENVs
    7. You probably want to turn off Automatic Deploy from settings

If importing data

  1. Add a persistent disk to the service that need access to data
  2. Map the disk to, e.g. /var/data.
  3. Enable SSH access
  4. Transfer data with scp -s -r /local/path/to/data server-ssh-name@ssh.frankfurt.render.com:/var/data
    • Get the server address from the Connect > SSH button on the service page
    • The remote path /var/data should match the one you defined in step 2
  5. Update any ENV variables to point to this path
  6. If you want to use the path in the Dockerfile, use the ARG command after the first from statement:
FROM node:18-alpine as base
WORKDIR /usr/src/app
ARG ENV_VAR_NAME_POINTING_TO_DATA
# Do smth with the path
CMD foo $ENV_VAR_NAME_POINTING_TO_DATA

Adding subdomains

  1. Go to Render
    1. Select Frontend Service
    2. Custom Domain: Add
    3. SUBDOMAIN.foo.bar
    4. Get settings
  2. Go to cloudflare.com or similar
    1. Go to DNS
      1. New CNAME
      2. Name: SUBDOMAIN
      3. Target: Render url
  3. Go to Render
    1. Verify
kaljarv commented 1 week ago

Duplicate of #594