Use `exec` instead of `run` in Docker init steps.

This commit is contained in:
Christopher Charbonneau Wells 2017-11-26 14:02:57 -05:00
parent 823b2e764b
commit 57c606aad5
2 changed files with 8 additions and 12 deletions

View File

@ -85,21 +85,17 @@ containers - one for the database and one for the application.
cp docker.env.example docker.env cp docker.env.example docker.env
editor docker.env editor docker.env
1. Build the web container 1. Build/run the application
docker-compose build docker-compose up -d
1. Initialize the database (this will also build the db container) 1. Initialize the database *(first run/after updates)*
docker-compose run --rm web python manage.py migrate docker-compose exec app python manage.py migrate
1. Initialize static assets 1. Initialize static assets *(first run/after updates)*
docker-compose run --rm web python manage.py collectstatic docker-compose exec app python manage.py collectstatic
1. Launch! :rocket:
docker-composer up
The app should now be locally available at The app should now be locally available at
[http://127.0.0.1:8000](http://127.0.0.1:8000). See [http://127.0.0.1:8000](http://127.0.0.1:8000). See
@ -121,7 +117,7 @@ for detailed information about Nanobox's deployment and configuration process.
cd babybuddy cd babybuddy
1. Add the `SECREY_KEY` and `DJANGO_SETTINGS_MODULE` environment variables 1. Add the `SECRET_KEY` and `DJANGO_SETTINGS_MODULE` environment variables
nanobox evar add DJANGO_SETTINGS_MODULE=babybuddy.settings.nanobox nanobox evar add DJANGO_SETTINGS_MODULE=babybuddy.settings.nanobox
nanobox evar add SECRET_KEY=<CHANGE TO SOMETHING RANDOM> nanobox evar add SECRET_KEY=<CHANGE TO SOMETHING RANDOM>

View File

@ -3,7 +3,7 @@ version: "2"
services: services:
db: db:
image: postgres image: postgres
web: app:
env_file: docker.env env_file: docker.env
build: . build: .
command: gunicorn -c /app/gunicorn.py babybuddy.wsgi command: gunicorn -c /app/gunicorn.py babybuddy.wsgi