Docker instructions

This commit is contained in:
Oleg Lavrovsky 2017-03-28 23:21:54 +02:00
parent 9d607b1ee7
commit 97a8119efb
4 changed files with 7 additions and 8 deletions

View File

@ -6,9 +6,6 @@ WORKDIR /usr/src/app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
RUN python manage.py migrate
RUN python manage.py createsuperuser
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV LANG en_US.UTF-8

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.env
*.pyc
.sass-cache
.DS_Store

View File

@ -60,9 +60,9 @@ Now access the admin panel with the user account you created earlier: http://loc
## Production notes
We are using [Dokku](http://dokku.viewdocs.io/) for automated deployment.
We suggest using Docker or [Dokku](http://dokku.viewdocs.io/) for automated deployment.
```
sudo dokku apps:create phase-alpha
sudo dokku config:set phase-alpha BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-python
docker-compose run web python manage.py migrate
docker-compose run web python manage.py createsuperuser
```

View File

@ -10,12 +10,13 @@ web:
ports:
- "5000:5000"
environment:
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- SECRET_KEY=${SECRET_KEY}
- DEBUG=${DEBUG}
- DEV=${DEBUG}
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
- DATABASE_URL=postgres://postgres:@postgres:5432/postgres
- ELASTICSEARCH_URL=http://elasticsearch:9200
- SECRET_KEY=${SECRET_KEY}
- ALLOWED_HOSTS=${HOSTNAME}
frontend:
build: .
dockerfile: .dockerfile-frontend