community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r1695988 - /comdev/tools/readme.md
Date Fri, 14 Aug 2015 21:26:37 GMT
Author: rgardler
Date: Fri Aug 14 21:26:37 2015
New Revision: 1695988

URL: http://svn.apache.org/r1695988
Log:
Improve the dev environment setup instructions. Document the use of the deploy.sh script

Modified:
    comdev/tools/readme.md

Modified: comdev/tools/readme.md
URL: http://svn.apache.org/viewvc/comdev/tools/readme.md?rev=1695988&r1=1695987&r2=1695988&view=diff
==============================================================================
--- comdev/tools/readme.md (original)
+++ comdev/tools/readme.md Fri Aug 14 21:26:37 2015
@@ -74,8 +74,15 @@ For more information on how the applicat
 understadn Django. A great starting point is the [Django
 tutorial](https://docs.djangoproject.com/en/1.8/intro/tutorial01/)
 
+## With Docker
 
-## Docker Prerequisites ##
+### Docker Prerequisites
+
+You need to install Docker for local development on Linux or Mac. You
+will probably want to also install docker-machine if you are going to
+deploy the application.
+
+#### For Windows
 
 If you are using Windows as your client machine then it is a good idea
 to install Git for Windows from http://msysgit.github.io/. This will
@@ -93,13 +100,21 @@ for Windows):
 $ curl -L https://get.docker.com/builds/Windows/x86_64/docker-latest.exe > /bin/docker
 $ curl -L https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_windows-amd64.exe
> /bin/docker-machine
 
+#### For Linux or Mac
+
 See the Docker website for instructions on installing Docker and Docker 
 Machine on other platforms see: http://docs.docker.com/machine/
 
 ### Docker Hosts ###
 
-As a minimum you will need a Docker host for development. You'll most likely
-want this to be on your local machine. So run the following command (as an 
+As a minimum you will need a Docker host for development. You'll most
+likely want this to be on your local machine. If you are on Linux you
+don't need to do anything, skip to the next section. If you are on
+Windows or Mac you will need to create a Docker host on your machine.
+
+#### Create a Docker Host on Windows
+
+We'll use docker-machine. Run the following command (as an
 administrator):
 
 	$ docker-machine create -d hyper-v comdev
@@ -112,11 +127,17 @@ machine. Run the following command:
 
 	$ eval "$(docker-machine env comdev)"
 
-#### Share your project code with the Docker Host ####
+### Share your project code with the Docker Host
 
-You need to ensure your project directory is available on the Docker
-Host. On Windows you will need to share it explicitly. We've provided
-a helper script to do this. First, create a confiduration file:
+For easy development you need to ensure your project directory is
+available on the Docker Host. Again, on Linux this is simple, skip
+ahead to the next section. If you are on Mac or Windows there is a
+little setup needed.
+
+#### Sharing on Windows
+
+We've provided a helper script to do this. First, create a
+confiduration file:
 
 	$ cp scripts/config.tmpl scripts/config.sh
 
@@ -133,7 +154,7 @@ the Docker Host to share the directory y
 Once done you will not need to run this script again unless you
 recreate the host.
 
-## Build and Start Your Development Containers ##
+### Build and Start Your Development Containers
 
 As a Docker based application you will work directly with Docker
 containers during development. Your local client development directory
@@ -144,33 +165,32 @@ The first time you run the container you
 database. Subsequent runs will just require standard Django commands
 to be run.
 
-### First Run ###
+#### Starting the Development Containers
 
-As with all Docker containers the first time you build and run them
-the images and corresponding layers need to be downloaded. This can
-take a few minutes. After the first run everything is very quick.
+We've provided some scripts that will help manage this process. If you
+want to see what's happening read the scripts.
 
-Ensure you are in the project root and then start the postgres
-database container:
+To start the application in development mode run the following
+command:
 
-	$ docker run -d -v //home/docker/project:/project -p 5432:5432 --name comdev_db postgres
+./scripts/deploy.sh
+
+You will be asked where you want to deploy the application. If you are
+on Linux you can respond "local". If you are on Mac or Windows you
+will want to respond "dev". The difference here is that "dev" assumes
+we are deploying to a docker host running in a virtual machine which
+is necessary on Mac and Windows, but optional on Linux.
+
+This script will then build and start your containers, sharing your
+source directory with the container. This means you can make changes
+on your development machine and see them reflected immediately on the
+running applicaion container.
 
-Build the application container:
-
-	$ docker build -t comdev .
-
-Configure the application and the database:
-
-	$ docker run --rm -v //home/docker/project:/project --link comdev_db:db comdev python manage.py
makemigrations events_list
-	$ docker run --rm -v //home/docker/project:/project --link comdev_db:db comdev python manage.py
migrate
-
-Now, run the application:
-
-	$ docker run --rm -v //home/docker/project:/project --link comdev_db:db -p 80:8000 --name
comdev_app comdev python manage.py runserver 0.0.0.0:8000
-
-Now you can visit the app at http://docker.host
+As with all Docker containers the first time you build and run them
+the images and corresponding layers need to be downloaded. This can
+take a few minutes. After the first run everything is very quick.
 
-### Running Django Commands ###
+#### Running Django Commands
 
 From this point development is just like any other Django application,
 but to run Django commands in the app container you will need to open
@@ -178,7 +198,7 @@ a terminal on that machine. To do this r
 
 	$ docker exec -it comdev_app bash
 
-### Using the Admin Interface ###
+### Using the Admin Interface
 
 To access the admin interface of the application you need an admin
 user account. Assuming you are starting from a clean development



Mime
View raw message