Skip to content
Snippets Groups Projects
Commit e3f1bf8b authored by Hobbs, Alexandra (Contractor)'s avatar Hobbs, Alexandra (Contractor)
Browse files

updated readme and clarified some points on the local_development docs

parent d83bf629
No related branches found
No related tags found
1 merge request!352Dockerize
...@@ -81,34 +81,7 @@ output_factory.write_file( ...@@ -81,34 +81,7 @@ output_factory.write_file(
### Docker ### Docker
Docker is the simplest install option. Docker is the simplest install option. Find instructions [here](./localdev/local_development.md).
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
```
## Algorithms ## Algorithms
......
# Local Development # Local Development
## Background ## Background
This docker-compose can replace the docker-compose in geomag-stacks. This docker-compose uses the existing 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.
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.
## Prerequisites ## Prerequisites
For mac development: For mac development:
...@@ -27,11 +23,16 @@ export MYSQL_ROOT_PASSWORD="" ...@@ -27,11 +23,16 @@ export MYSQL_ROOT_PASSWORD=""
``` ```
## Use ## 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 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 ## Helpful Docker Commands
`docker ps` shows the running containers. `docker ps` shows the running containers.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment