This is a Docker setup for a web application based on Django.
- The Django application is served by Gunicorn (WSGI application).
- We use NginX as reverse proxy and static files server. Static files are persistently stored in volumes.
- MariaDB is used. Data are persistently stored in local files.
- Python dependencies are managed through pipenv, with Pipfile and Pipfile.lock.
Also a Makefile is available for convenience. You might need to use sudo make
instead of just make
because docker and docker-compose commands often needs admin privilege.
Note: Make
command may not run on Windows !
You need to install Docker and Docker-Compose.
In the first time, you should execute these commands step by step.
docker-compose build
docker-compose run --rm django answerplatform/manage.py migrate
docker-compose run --rm django answerplatform/manage.py collectstatic --no-input
docker-compose down
docker-compose up
The server will run on port 8000
, so you can visit localhost/backend/admin/ to access to your Django server.
Stop the Django server with:
docker-compose down
cd frontend
npm run serve
The frontend will serve on localhost:8080