Docker settings (#62)

* added docker compose files

* updated the version of docker image

* added author info
This commit is contained in:
Chaitanya 2018-08-08 19:44:45 +05:30 committed by GitHub
parent 53e5bd0fa5
commit 3d9f00c19c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 0 deletions

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
LABEL authors="Micropyramid"
FROM python:3.6
WORKDIR /app
# Intall dependencies
COPY requirements.txt /app/
COPY . /app
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]

15
crm/dev_settings.py Normal file
View file

@ -0,0 +1,15 @@
from .settings import *
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
ALLOWED_HOSTS = ['*']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': 5432,
}
}

16
docker-compose.yml Normal file
View file

@ -0,0 +1,16 @@
version: '1.0'
services:
db:
image: postgres
volumes:
- /home/db:/var/lib/postgresql/data
dockertest:
build: .
image: micropyramid/django-crm:1
environment:
- DJANGO_SETTINGS_MODULE=crm.dev_settings
ports:
- "8000:8000"
depends_on:
- db

10
entrypoint.sh Normal file
View file

@ -0,0 +1,10 @@
#!/bin/bash
# Install dependencies
pip install -r requirements.txt
# Execute startup scripts
python manage.py collectstatic --noinput
python manage.py migrate
python manage.py runserver 0.0.0.0:8000