Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Example using Docker, Django, multiple Postgres databases, NginX, Gunicorn, pipenv, GitLab CI and tox.

License

NotificationsYou must be signed in to change notification settings

pawamoy/docker-nginx-postgres-django-example

Repository files navigation

This is aDocker setup for a web application based on Django.

  • TheDjango application is served byGunicorn (WSGI application).
  • We useNginX as reverse proxy and static files server. Static and media files arepersistently stored in volumes.
  • MultiplePostgres databases can be used. Data are persistently stored in volumes.
  • Python dependencies are managed throughpipenv, withPipfile andPipfile.lock.
  • Support for multiple environment settings (variableDJANGO_SETTINGS_MODULE is passedto thedjangoapp service).
  • Tests are run usingtox,pytest, and other tools such assafety,bandit,isort andprospector.
  • Continuous Integration is configured forGitLab with.gitlab-ci.yml.CI follows a Build-Test-Release flow.WARNING: this part is not fully functional yet.

Also aMakefile is available for convenience. You might need to usesudo makeinstead of justmake becausedocker anddocker-compose commands often needsadmin privilege.

Requirements

You need to installDocker andDocker-Compose.

Build

docker-compose build ormake build.

Migrate databases

docker-compose run --rm djangoapp hello/manage.py migrate ormake migrate.

Collect static files

docker-compose run --rm djangoapp hello/manage.py collectstatic --no-input' ormake collectstatic.

Run

docker-compose up ormake run.

Tests

  • make checksafety
  • make checkstyle
  • make test
  • make coverage

Related blog post

Docker Compose with NginX, Django, Gunicorn and multiple Postgres databases

License

Software licensed under theISC license.

About

Example using Docker, Django, multiple Postgres databases, NginX, Gunicorn, pipenv, GitLab CI and tox.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp