delphis-inc / delphisbe

Backend monolith for delphis
GNU General Public License v3.0
1 stars 1 forks source link

Delphis Backend Build

delphisbe

Backend monolith for delphis

Note: To get service running locally, kick off enginx using the nginx/.../local.delphishq.com config. Also need to add mapping to /etc/hosts for local.delphishq.com

Get started

A few things you'll need to install. Assuming you're on mac:

Okay at this point you should have the local server up and running. It has no data so let's do that:

And you're done!

Install Local tools

1) Install Mockery via go get -u github.com/vektra/mockery/.../.

Build and deploy docker image

Retrieve credentials, build image, tag image, and push image.

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 033236388136.dkr.ecr.us-west-2.amazonaws.com/delphisbe
docker build -t delphisbe .
docker tag delphisbe:latest 033236388136.dkr.ecr.us-west-2.amazonaws.com/delphisbe:latest
docker push 033236388136.dkr.ecr.us-west-2.amazonaws.com/delphisbe:latest

Database setup

I had to do the following:

Local to remote AWS database

Setup the jumpbox:

Host delphis-bastion-db
     HostName ec2-34-208-84-118.us-west-2.compute.amazonaws.com
     IdentityFile /Users/ned/.ssh/delphis-keypair.pem
     LocalForward 3333 chatham-staging-aurora-pgsql.cluster-cgw5uhmof8wi.us-west-2.rds.amazonaws.com:5432
     User ec2-user

and kick it off. Then use localhost:3333 for the database.

Terraform

Please run terraform using these commands. This will leverage the S3 backend.

AWS_PROFILE=delphis make plan env=staging
AWS_PROFILE=delphis make apply env=staging

Infra todos: