Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Run setup-django.sh bash.sh as the default command for django ser…
Browse files Browse the repository at this point in the history
…vice.

This should give people a look at the list of commands they can run in
the shell, and make it easier to switch between the Django dev server,
nginx/gunicorn, running tests, etc., without having to interact with
Docker for every command and wait for the entrypoint/setup every time.
  • Loading branch information
mrmachine committed Sep 19, 2016
1 parent 998dd8d commit 501bbab
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 23 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,29 @@ Build a Docker image:
$ cd <project_name>
$ docker-compose build --pull

Run a `django` container and all of its dependancies:

$ docker-compose run --rm --service-ports django

Create a superuser account:

$ docker-compose run --rm django manage.py createsuperuser
# manage.py createsuperuser

Run the project:
Run the Django dev server:

$ docker-compose run --rm --service-ports django
# runserver.sh

## 3. That's it!

Open your new site in a browser:
Open the site in a browser:

http://localhost:8000

When you're done, exit the container and stop all of its dependencies:

# exit
$ docker-compose stop

# Next steps

* [Start building your site](docs/howto/start.md)
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
command: setup-django.sh celeryflower.sh
extends: django
django:
command: setup-django.sh runserver.sh
command: setup-django.sh bash.sh
environment:
BASE_SETTINGS_MODULE: develop
MASTER_PASSWORD: # Get from environment
Expand Down
30 changes: 21 additions & 9 deletions docs/contributing/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,41 @@ Get the code:
$ git clone https://github.com/ic-labs/django-icekit.git
$ cd django-icekit

Build a Docker image:
Run a `django` container and all of its dependancies:

$ docker-compose build --pull
$ docker-compose run --rm --service-ports django

Run the tests:

# runtests.sh

Create a superuser account:

$ docker-compose run --rm django manage.py createsuperuser
# manage.py createsuperuser

Run the project:
Run the Django dev server:

$ docker-compose run --rm --service-ports django
# runserver.sh

Now you can open the site in a browser:
Open the site in a browser:

http://localhost:8000

Stop all services:
When you're done, exit the container and stop all of its dependencies:

# exit
$ docker-compose stop

Run the tests:
## Running multiple containers

Only one container can bind a fixed service port on the host at a time.

If you want to run a second container, for example to run tests in while
running the Django dev server, you will need to run it with a different fixed
port or a dynamic port:

$ docker-compose run --rm django runtests.sh
$ docker-compose run --rm -p 8001:8000 django # fixed: 8001->8000
$ docker-compose run --rm -p 8000 django # dynamic, check with docker-compose ps

# Run without Docker

Expand Down
17 changes: 13 additions & 4 deletions docs/intro/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,29 @@ Build a Docker image:
$ cd <project_name>
$ docker-compose build --pull

Run a `django` container and all of its dependancies:

$ docker-compose run --rm --service-ports django

Create a superuser account:

$ docker-compose run --rm django manage.py createsuperuser
# manage.py createsuperuser

Run the project:
Run the Django dev server:

$ docker-compose run --rm --service-ports django
# runserver.sh

## 3. That's it!

Open your new site in a browser:
Open the site in a browser:

http://localhost:8000

When you're done, exit the container and stop all of its dependencies:

# exit
$ docker-compose stop

# Next steps

* [Start building your site](../howto/start.md)
Expand Down
17 changes: 13 additions & 4 deletions icekit/bin/startproject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,27 @@ Build a Docker image:
$ docker-compose build --pull
Run a 'django' container and all of its dependancies:
$ docker-compose run --rm --service-ports django
Create a superuser account:
$ docker-compose run --rm django manage.py createsuperuser
# manage.py createsuperuser
Run the project:
Run the Django dev server:
$ docker-compose run --rm --service-ports django
# runserver.sh
Now you can open the site in a browser:
Open the site in a browser:
http://localhost:8000
When you're done, exit the container and stop all of its dependencies:
# exit
$ docker-compose stop
Read our [Docker Quick Start](https://github.com/ic-labs/django-icekit/blob/${BRANCH}/docs/docker-quick-start.md)
guide for more info on running an ICEkit project with Docker.
Expand Down
2 changes: 1 addition & 1 deletion project_template/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
command: setup-django.sh celeryflower.sh
extends: django
django:
command: setup-django.sh runserver.sh
command: setup-django.sh bash.sh
environment:
BASE_SETTINGS_MODULE: develop
MASTER_PASSWORD: # Get from environment
Expand Down

0 comments on commit 501bbab

Please sign in to comment.