From e3f1bf8b46f567f75737c6916d561962bb55a7b8 Mon Sep 17 00:00:00 2001 From: Alexandra Hobbs <ahobbs@contractor.usgs.gov> Date: Wed, 20 Nov 2024 11:41:57 -0700 Subject: [PATCH] updated readme and clarified some points on the local_development docs --- README.md | 29 +---------------------------- localdev/local_development.md | 13 +++++++------ 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 9de81eed..436c9247 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 e3e216d9..ec84029c 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. -- GitLab