Suceco Django API Project
The API Documentation is available at the path /api/docs. For instance: https://localhost:8000/api/docs.
docker build .
docker-compose build
docker-compose run --rm app sh -c "django-admin startproject app ."
docker-compose run --rm app sh -c "python manage.py wait_for_db && python manage.py test"
docker-compose run --rm app sh -c "coverage run manage.py test && coverage report -m"
docker-compose run --rm app sh -c "flake8"
To tell flake8 to ignore something, add # noqa to it.
docker-compose up
You can specify a specific yml file on your commands. For instance:
docker-compose -f docker-compose.yml up
docker-compose -f docker-compose.yml up --force-recreate --renew-anon-volumes
To run in the background add -d. For instance:
docker-compose -f docker-compose.yml up -d
docker-compose run --rm app sh -c "python manage.py startapp appname"
docker-compose run --rm app sh -c "python manage.py makemigrations && python manage.py wait_for_db && python manage.py migrate"
docker-compose run --rm app sh -c "python manage.py wait_for_db && python manage.py migrate"
docker-compose run --rm app sh -c "python manage.py showmigrations"
docker-compose run --rm app sh -c "python manage.py wait_for_db"
docker-compose run --rm app sh -c "python manage.py createsuperuser"
The production environment will run the system using gunicorn and nginx. Check the port it will be running at the nginx service defined in the docker-compose.prod.yml file. The command to build and run in the production mode is:
docker-compose -f docker-compose.prod.yml up -d --build
To stop:
docker-compose -f docker-compose.prod.yml stop