🐳 Change to the actual workdir

This commit is contained in:
Christian Mäder 2017-08-30 11:09:24 +02:00
parent 822350d666
commit ab0c255040
No known key found for this signature in database
GPG Key ID: 92FFD0A711F196BB
2 changed files with 6 additions and 4 deletions

View File

@ -27,10 +27,12 @@ RUN wget -q -O - "${URL}" | tar xz \
WORKDIR /opt/netbox
RUN pip install -r requirements.txt
RUN ln -s configuration.docker.py netbox/netbox/configuration.py
RUN ln -s configuration.docker.py /opt/netbox/netbox/netbox/configuration.py
COPY docker/gunicorn_config.py /opt/netbox/
COPY docker/nginx.conf /etc/netbox-nginx/nginx.conf
WORKDIR /opt/netbox/netbox
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT [ "/docker-entrypoint.sh" ]

View File

@ -2,7 +2,7 @@
set -e
# run db migrations (retry on error)
while ! /opt/netbox/netbox/manage.py migrate 2>&1; do
while ! ./manage.py migrate 2>&1; do
sleep 5
done
@ -14,14 +14,14 @@ if [[ -z ${SUPERUSER_NAME} || -z ${SUPERUSER_EMAIL} || -z ${SUPERUSER_PASSWORD}
echo "Using defaults: Username: ${SUPERUSER_NAME}, E-Mail: ${SUPERUSER_EMAIL}, Password: ${SUPERUSER_PASSWORD}"
fi
python netbox/manage.py shell --plain << END
./manage.py shell --plain << END
from django.contrib.auth.models import User
if not User.objects.filter(username='${SUPERUSER_NAME}'):
User.objects.create_superuser('${SUPERUSER_NAME}', '${SUPERUSER_EMAIL}', '${SUPERUSER_PASSWORD}')
END
# copy static files
/opt/netbox/netbox/manage.py collectstatic --no-input
./manage.py collectstatic --no-input
# start unicorn
gunicorn --log-level debug --debug -c /opt/netbox/gunicorn_config.py netbox.wsgi