Elppir
Elppir

Reputation: 11

How to run database applications on go in docker on Debian

I have a question: I have an application with postgres DB, locally in my docker I initialized the DB with the command:

migrate -path ./schema -database 'postgres://postgres:pass@localhost:5436/postgres?sslmode=disable' up

The file with the postfix up stores table descriptions. Did it once and that's it, everything is stored in the container.

Now I'm facing a problem. Knocked down the database and application with docker-compose, ran the image in the hub.

I took a server on Debian, installed docker there, logged in, downloaded the image and launched the container. Everything, the application works, but the database tables are missing, how to initialize them on the server?

Locally on my computer I used migrate, how to initialize and create database tables in the application on the server - I do not know

Upvotes: 1

Views: 49

Answers (0)

Related Questions