Skip to content

Commit 0f1ae4e

Browse files
committed
Auto merge of #1637 - bryanburgers:fix-docker-compose-backend, r=jtgeibel
docker: use --locked-schema for diesel migrations When using `docker-compose up` to bring up everything for development, we mount the source directory as read-only so that changes can only happen on the host machine and not because of something that the code running in docker does. This read-only mount was causing problems because `patch`, called by `diesel migration run`, would try to write to the filesystem and fail. When bringing up a docker environment for the first time from a fresh clone, we expect that the schema.rs file is already pristine, and that we just need to run migrations. For that reason, use `diesel migration run`'s `--locked-schema` option to just run migrations. This change makes it so that a new contributor can clone the repo, run `docker-compose up`, and have an almost complete environment to poke at and start exploring. Fixes #1631
2 parents 4232257 + ab399e2 commit 0f1ae4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docker_entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# If the backend is started before postgres is ready, the migrations will fail
4-
until diesel migration run; do
4+
until diesel migration run --locked-schema; do
55
echo "Migrations failed, retrying in 5 seconds..."
66
sleep 5
77
done

0 commit comments

Comments
 (0)