I am tasked with creating a click-button style use of Docker for developers of a Django app to do local development.
I am using docker-compose
in combination with private repos on my Docker Hub and it's working well.
Except that the app has no default data. The developers have requested to use a full prod dump rather than fixtures with loaddata
.
Therefore I built a container based on this Dockerfile
FROM python:2.7
COPY . /opt/mysite.com
WORKDIR /opt/mysite.com
ENV WAITFORIT_VERSION="v1.3.1"
RUN wget -q -O /usr/local/bin/waitforit https://github.com/maxcnunes/waitforit/releases/download/$WAITFORIT_VERSION/waitforit-linux_amd64 \
&& chmod +x /usr/local/bin/waitforit
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get -y update && apt-get -y install mysql-client nodejs
RUN pip install -r requirements/local.txt
RUN npm install
RUN ./node_modules/.bin/babel-node ./node_modules/.bin/webpack
CMD waitforit -full-connection=tcp://mysql:3306 -timeout=60 -debug && mysql -u root -h mysql --password=**** mysite_develop < prod.sql && /bin/bash -c "source /opt/mysite.com/env.local && python manage.py collectstatic --noinput && python /opt/mysite.com/manage.py runserver 0.0.0.0:5000"
All works well except that it takes a very long time to be able to see localhost:5000
after the containers are up.
Therefore I started to investigate data-only
containers, but I am wondering what happens when I push that container to Docker hub? Can it be pulled with the mysql data baked onto from docker-compose
?
If not, then how can I fix the above Dockerfile