diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..54a65ec5528393e225985428d8d03925f3f2353c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3 + +COPY . /tmp/ +RUN chmod +x /tmp/entrypoint.sh + +RUN pip install --no-cache-dir -r /tmp/requirements.txt + +RUN python /tmp/manage.py migrate +ENTRYPOINT ["/tmp/entrypoint.sh"] + +# Superuser parameters are --username USERNAME and --email EMAIL but there is no password +# RUN python /tmp/manage.py createsuperuser diff --git a/README.rst b/README.rst index 9223b93f8fe9a1ccfe52da8c7e57ef3055dc4b51..0302391c858b2d21ae7eacd236fbf989afb2b87a 100644 --- a/README.rst +++ b/README.rst @@ -5,6 +5,14 @@ AURA Steering: Program Scheduler Installation ------------ +If you have a working Docker environment, do:: + + $ docker build -t pv_container . + $ docker run -p 8000:8000 -d pv_container:latest + +and log into it at http://127.0.0.1:8000/admin/ with username "admin" and password "admin". Full setup without Docker is done as described below. + + To get setup you must have the following installed: * MySQL-Client Development libraries @@ -34,9 +42,10 @@ Setting up the database By default the project is set up to run on a SQLite database. -Create a file pv/local_settings.py and add at least the line:: +Create a file pv/local_settings.py and add at least the two lines:: SECRET_KEY = 'secret key' + USE_TZ = False (obviously replacing "secret key" with a key of your choice). @@ -71,13 +80,6 @@ Create a file pv/mysql.cnf and give your MySQL credentials:: password = default-character-set = utf8 -Adding an admin user --------------------- - -In order to create an admin user (which you will need to login to the webinterface after the next step) run:: - - (python)$ python manage.py createsuperuser - Running a web server -------------------- @@ -87,4 +89,6 @@ In development you should run:: (python)$ python manage.py runserver -After this you can open http://127.0.0.1:8000/admin in your browser and log in with the admin credential you created previously. \ No newline at end of file +After this you can open http://127.0.0.1:8000/admin in your browser and log in with username "admin" and password "admin". + +Make sure to change your password by visiting http://127.0.0.1:8000/admin/auth/user/1/password/ \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000000000000000000000000000000000000..a09fd6f84f1f914ee2527112f1371e33f63e3901 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +python /tmp/manage.py loaddata /tmp/program/fixtures/*.yaml +python /tmp/manage.py runserver 0.0.0.0:8000 + +exec "$@"