Allow flags for migrations

Switch Dockerfile from CMD to ENTRYPOINT so that flags can be passed
to the makemigrations command

This is required in cases where we need to use django's makemigrations
--merge to merge two migrations.
This commit is contained in:
James Polley 2017-09-17 12:51:10 +10:00
parent ecd4bc97bc
commit 62df4ec3de
2 changed files with 2 additions and 2 deletions

View file

@ -18,5 +18,5 @@ RUN set -ex \
&& apt-get install -y git xmlsec1 libmysqlclient18 \ && apt-get install -y git xmlsec1 libmysqlclient18 \
&& apt-get install -y $buildDeps --no-install-recommends && apt-get install -y $buildDeps --no-install-recommends
RUN pip install -c /setup/constraints.txt -r /setup/requirements.txt RUN pip install -c /setup/constraints.txt -r /setup/requirements.txt
CMD ["python","/source/manage.py", "makemigrations"] ENTRYPOINT ["python","/source/manage.py", "makemigrations"]

View file

@ -1,4 +1,4 @@
#!/bin/bash -x #!/bin/bash -x
docker image build -f docker/Dockerfile.makemigrations -t makemigrations . docker image build -f docker/Dockerfile.makemigrations -t makemigrations .
docker run -it --env-file=docker/laptop-mode-env -v $(pwd):/source makemigrations docker run -it --env-file=docker/laptop-mode-env -v $(pwd):/source makemigrations $*