The goal of this docker image is to easily manage RethinkDB migrations through the node rethink-migrate tool.
/data/rethinkdbdatabase.json config file and a migrations folder will all the migration files. Make sure to specify a proper host to be able to connect to the rethinkdb database depending on where that is. For example if rethinkdb is running on your Mac development machine you can pass docker.for.mac.localhost as the host in the database.json config file. Alternatively if the database is running through another docker container, you can link the two through docker networks. This is easier if managing all this through docker compose.rethink-migrate binary is expose through the ENTRYPOINTrethink-migrate ... would now become docker run --rm -v "$PWD":/data/rethinkdb egjiri/rethink-migrate ...$PWD can be replaced with the absolute path to the volume source datarethink-migrate. To do that, add the following line to your .bash_profile configalias rethink-migrate="docker run --rm -v '$PWD':/data/rethinkdb egjiri/rethink-migrate"
createdocker run --rm -v "$PWD":/data/rethinkdb egjiri/rethink-migrate create ...
updocker run --rm -v "$PWD":/data/rethinkdb egjiri/rethink-migrate up
downdocker run --rm -v "$PWD":/data/rethinkdb egjiri/rethink-migrate down
down --alldocker run --rm -v "$PWD":/data/rethinkdb egjiri/rethink-migrate down --all
The more likely use-case for this image is through docker-compose.
Here is a sample docker-compose.yaml file to get you started.
---
version: "3"
services:
migrate:
image: egjiri/rethink-migrate
volumes:
- .:/data/rethinkdb
command: "up"
depends_on:
- db
db:
image: rethinkdb:2.3.6
ports:
- 8080:8080
volumes:
- rethinkdb_data:/data
Content type
Image
Digest
Size
22.4 MB
Last updated
about 8 years ago
docker pull egjiri/rethink-migrate