diff --git a/README.md b/README.md index 9de81eed3331cd64d729eca0df52c30e79c3af90..436c9247415e5212f0cb71803ef5488221a81772 100644 --- a/README.md +++ b/README.md @@ -81,34 +81,7 @@ output_factory.write_file( ### Docker -Docker is the simplest install option. - -1. Create and start a new container - - named `geomagio`, - listening on local port `8000`, - from the image `usgs/geomag-algorithms` on docker hub - - ``` - docker run -dit --name geomagio -p 8000:8000 usgs/geomag-algorithms - ``` - -2. Use the running container - -- Run the `geomag.py` command line interface: - - > To work with files outside the container, - > use a volume mount when starting the container - - ``` - docker exec -it geomagio geomag.py - ``` - -- Or, to run an interactive python prompt: - - ``` - docker exec -it geomagio python - ``` +Docker is the simplest install option. Find instructions [here](./localdev/local_development.md). ## Algorithms diff --git a/localdev/local_development.md b/localdev/local_development.md index e3e216d969d7742c2673aee7480d46aaa24239d8..ec84029c5814f90501670463643b913e22fe8aac 100644 --- a/localdev/local_development.md +++ b/localdev/local_development.md @@ -1,11 +1,7 @@ # Local Development ## Background -This docker-compose can replace the docker-compose in geomag-stacks. This docker-compose uses the existing -Dockerfile to create a `localdev-web-1` container. Ideally, this will more closely mimic what is happening in -production. This docker-compose is also creating a mysql container called `localdev-database-1` and initializing the metadata and session tables. It is also creating a `localdev-edge-1` container using the geomag-edge Dockerfile in geomag-stacks. -The geomag-edge folder was not moved out of geomag-stacks out of an abudance of caution to prevent internal information -from being revealed. +This workflow can replace the docker-compose in geomag-stacks. This docker-compose uses the existing Dockerfile to create a `localdev-web-1` container, instead of pulling down the latest geomag-algorithms image. However, it is initializing the mysql database the same way it is done in geomag-stacks. This docker-compose is also creating a mysql container called `localdev-database-1` an edge container called `localdev-edge-1` using the geomag-edge Dockerfile in geomag-stacks. The geomag-edge folder was not moved out of geomag-stacks out of an abudance of caution to prevent internal information from being revealed. ## Prerequisites For mac development: @@ -27,11 +23,16 @@ export MYSQL_ROOT_PASSWORD="" ``` ## Use -To simply start build and run all the containers, make sure you are in the /localdev directory and run the following command. +To simply start build and run all the containers, make sure you are in the /localdev directory and run the following command. This includes a reload command for the web container. It will restart the web container when changes are made locally. ``` docker-compose up ``` +If you're not developing locally, use the following command to run the containers in the background. Reload will not work this way. +``` +docker-compmose up -d +``` + ## Helpful Docker Commands `docker ps` shows the running containers.