Skip to content

bannmoore/roleplay-realm-archive-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Roleplay Realm Archive Infrastructure

Dependencies

This project expects the following repos to be cloned into the same workspace:

  • roleplay-realm-archive
  • roleplay-realm-archive-db

Quick Start

# roleplay-realm-archive-infra
./bin/local/db_up.sh
./bin/local/app_up.sh

# roleplay-realm-archive-db
./bin/migrate

Deploy

Prerequisites

This Terraform configuration expects the following resources to already exist:

  • A container app registry called "bam"

Deployment

Deploy NextJS app by publishing new Docker image

./bin/deploy/app.sh

Deploy DigitalOcean infrastructure

./bin/terraform.sh plan

./bin/deploy/infra.sh

# ONLY DO THIS IF YOU WANT TO BLOW EVERYTHING UP
./bin/terraform.sh destroy

(First Time) Set up Jump Server

Heads up: This assumes you're running these steps in the applied terraform workspace, with outputs available.

./bin/jump/connect.sh

# On jump server, generate ssh key.
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
# (copy the public key and add it to GitHub)

# Clone database repo
cd /mnt/rra_jump_server_volume
git clone git@github.com:bannmoore/roleplay-realm-archive-db.git
cd roleplay-realm-archive-db

# Run migrations
source ../.env
./bin/jump_setup.sh
./bin/migrate.sh

To run new migrations:

./bin/jump/connect.sh

cd /mnt/rra_jump_server_volume/roleplay-realm-archive-db
git pull
source ../.env
./bin/migrate.sh

Gotchas

DigitalOcean expects the amd64 platform

If the published image is built on the arm64 platform, it won't work on Digital Ocean. Check it like so:

docker image ls | grep bam 
docker inspect <IMAGE_ID> --format '{{.Architecture}}'

This should print out amd64. If not, the image needs to be rebuilt with the --platform=linux/amd64 flag.

Can not delete default VPCs

If your digitalocean_vpc resource is the first one for a region, it will automatically become the default. In order to run terraform destroy, create another one via the console and set it to default.

Gratitude to these Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published