Skip to content

Commit

Permalink
Tweak Docker config files and add documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubz committed Nov 24, 2017
1 parent 12254b0 commit 823b2e7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN gulp build


FROM python:3 as app
ENV PYTHONUNBUFFERED 1
RUN pip install --upgrade pipenv gunicorn
WORKDIR /app
COPY Pipfile /app/
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ work.
- [Demo](#demo)
- [Deployment](#deployment)
- [AWS Elastic Beanstalk](#aws-elastic-beanstalk)
- [Docker](#docker)
- [Nanobox](#nanobox)
- [Heroku](#heroku)
- [Manual](#manual)
Expand Down Expand Up @@ -72,6 +73,39 @@ for detailed information.
The create command will also do an initial deployment. Run `eb deploy` to
redeploy the app (e.g. if there are errors or settings are changed).

### Docker

A Docker deploy requires [Docker](http://docker.com/) and
[Docker Compose](https://docs.docker.com/compose/overview/) to create two
containers - one for the database and one for the application.

1. Copy the `docker.env.example` to `docker.env` and set the `ALLOWED_HOSTS` and
`SECRET_KEY` variables within

cp docker.env.example docker.env
editor docker.env
1. Build the web container

docker-compose build
1. Initialize the database (this will also build the db container)

docker-compose run --rm web python manage.py migrate

1. Initialize static assets

docker-compose run --rm web python manage.py collectstatic
1. Launch! :rocket:

docker-composer up
The app should now be locally available at
[http://127.0.0.1:8000](http://127.0.0.1:8000). See
[Get Started, Part 6: Deploy your app](https://docs.docker.com/get-started/part6/)
for detailed information about how to deployment methods with Docker.

### Nanobox

An example [Nanobox](https://nanobox.io/) configuration, `boxfile.yml`, is
Expand Down
2 changes: 1 addition & 1 deletion docker.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ALLOWED_HOSTS=
DEBUG=False
DJANGO_SETTINGS_MODULE=babybuddy.settings.docker
PYTHONUNBUFFERED=1
SECRET_KEY=

0 comments on commit 823b2e7

Please sign in to comment.