A handly Docker image of goose.
- Store sql schema files in
./schema
- Save .env file
GOOSE_DRIVER=postgres GOOSE_DBSTRING="postgres://user:password@qwerty.us-east-1.redshift.amazonaws.com:5439/db"
- To
goose up
, write docker-compose.yml as followingversion: '3' services: migration: image: ghcr.io/tk42/goose:latest platform: linux/amd64 # If you use M1 Mac env_file: - .env working_dir: "/src" volumes: - "./schema:/src" command: "up" depends_on: - postgres postgres: image: postgres:latest env_file: - .env ports: - 5432:5432 volumes: - postgres_data:/var/lib/postgresql/data/ volumes: postgres_data: