Sign inSign up

yoshi429/goose-migration

By yoshi429

•Updated over 3 years ago

migration for postgres

Image
0

2.4K

yoshi429/goose-migration repository overview

⁠Directory structure

here⁠ is Github repo

workdir is go/src

.
├── Dockerfile
├── README.md
├── db
│   └── *sql
└── entrypoint.sh

⁠How to Use

⁠1. Mount your sql file to go/src/db
⁠2. Set DB connection Information to environment variable
keyvalue
DB_HOSTenvironment variable sets the host name of the machine on which the server is running.
DB_PORTenvironment variable sets the TCP port.
DB_USERenvironment variable sets the name for connect to the database as the user
DB_PASSWORDenvironment variable sets the superuser password for PostgreSQL.
DB_NAMEenvironment variable sets the name of the database to connect to.
DB_SSLenvironment variable sets the value of ssl mode.

⁠Example

docker-compose.yaml

  migration:
    image: yoshi429/goose-migration:latest
    depends_on:
      postgres :
        condition: service_healthy
    volumes:
      - ./{sqlfile_path}:/go/src/db
    env_file:
      - .env

.env

DB_HOST=postgres
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=postgres
DB_SSL=disable

Tag summary

Content type

Image

Digest

sha256:712b31705…

Size

583.8 MB

Last updated

over 3 years ago

docker pull yoshi429/goose-migration