Open Marie000 opened 2 years ago
I can confirm the droplet ink-API-dev
is now connected to a managed instance of PostgreSQL.
ink-api
ink-API-dev
and ink-API-prod
onlyink_dev
and ink_prod
databases/etc/rebus-ink-api
; renamed .env
to env
and placed the DB certificate there toodocker exec ink-api npx knex migrate:latest
. postgres-data
volume now we are using a managed postgres cluster.docker run -d -p 8080:8080 --restart=always --env-file /etc/rebus-ink-api/env -e DATABASE_CA_CERT="$(cat /etc/rebus-ink-api/ca-certificate.crt)" --name ink-api rebusink/ink-api
docker exec ink-api npx knex migrate:latest
Recommendation to start using tags e.g.
dev-20220629a
(development)1.2.3
(production)build (local
):
git checkout dev
git pull
docker image build -t rebusink/ink-api:dev-20220629a .
docker image push rebusink/ink-api:dev-20220629a
release (ink-API-dev
):
docker pull rebusink/ink-api:dev-20220629a
docker run ink-api npx knex migrate:latest TODO ????
run (ink-API-dev
):
docker restart ink-api
If environment vars have changed you'll need to stop and start the container.
The API is working on digitalOcean but not connecting to the database.
Some things to look at:
.env variables POSTGRE_DB='ink_test' POSTGRE_USER='postgres' POSTGRE_PASSWORD='postgres' POSTGRE_INSTANCE='postgres'
digitalOcean volume attached to the droplet where the API is
is the database properly migrated? I think it is, but I am not sure.