Skip to content

Docker Compose to set up and run a simple Django/MariaDB app

License

Notifications You must be signed in to change notification settings

damufo/docker-django-mariadb-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-django-mariadb-compose

Docker Compose to set up and run a simple Django/MariaDB app

This quick-start guide demonstrates how to use Docker Compose to set up and run a simple Django/MariaDB app. Requirements:

  • Docker
  • Docker-compose

Installation

$ git clone https://github.com/damufo/docker-django-mariadb-compose.git
$ cd docker-django-mariadb-compose
$ docker-compose run web django-admin startproject composeexample .
$ sudo chown -R $USER:$USER .

Edit file composeexample/settings.py and set database section as:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'mariadb',
        'USER': 'mariadb',
        'PASSWORD': 'mariadb',
        'HOST': 'db',
        'PORT': 3306,
        'OPTIONS': {
            'init_command': "SET sql_mode='STRICT_TRANS_TABLES', innodb_strict_mode=1",
        },
    }
}

Finally:

$ docker-compose up

or

$ docker-compose up -d

and open http://localhost:8009/

About

Docker Compose to set up and run a simple Django/MariaDB app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published