$ git clone https://github.com/RicardoVeronica/docker-hub-django.git
environment:
- POSTGRES_DB=[your-db-name]
- POSTGRES_USER=[your-username]
- POSTGRES_PASSWORD=[your-password]
$ docker-compose run --rm web django-admin startproject [your-project-name] .
$ sudo chown -R $USER:$USER .
# [your-project-name]/settings.py
ALLOWED_HOST = ['*']
# [your-project-name]/settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': '[your-db-name]',
'USER': '[your-username]',
'PASSWORD': '[your-password]',
'HOST': 'db',
'PORT': 5432,
}
}
$ docker-compose up
0.0.0.0:8000