From 05c8ad65fb0b30ec49baaaba51658ac8c4d457f4 Mon Sep 17 00:00:00 2001
From: Alexandra Hobbs <ahobbs@contractor.usgs.gov>
Date: Tue, 19 Nov 2024 14:44:33 -0700
Subject: [PATCH] trying to add reload

---
 localdev/docker-compose.yml   | 5 ++++-
 localdev/local_development.md | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/localdev/docker-compose.yml b/localdev/docker-compose.yml
index 1b18a11d..5ffc161e 100644
--- a/localdev/docker-compose.yml
+++ b/localdev/docker-compose.yml
@@ -25,6 +25,7 @@ services:
     build:
       context: ../.
       dockerfile: ./Dockerfile
+    command: bash -c "cd /data && python create_db.py && python test_metadata.py && uvicorn --reload geomagio.api:app --host 0.0.0.0 --workers 2"
     ports:
       - '8000:8000'
     extra_hosts:
@@ -37,5 +38,7 @@ services:
       - OPENID_METADATA_URL=$OPENID_METADATA_URL
       - SECRET_KEY=$SECRET_KEY
       - SECRET_SALT=$SECRET_SALT
-      - WEBSERVICE=true
+      - WEBSERVICE=false
+    volumes:
+      - ../.:/data
     restart: always
diff --git a/localdev/local_development.md b/localdev/local_development.md
index 1a905d36..5f884c6c 100644
--- a/localdev/local_development.md
+++ b/localdev/local_development.md
@@ -52,5 +52,5 @@ and remove the images.
 `docker exec -it {CONTAINER ID} /bin/bash` execs into the container. This can be helpful for exploring the mysql db. After you exec into the mysql container, run `mysql -u root -p` in the container. Input the password you set to MYSQL_ROOT_PASSWORD. Now
 you can use SQL to explore the db.
 
-## Running the CLI locally
-Exec into the `localdev-web-1` container using
\ No newline at end of file
+## Helpful Tips
+Sometimes the mysql container exits immediately with code 139 due to insufficient memory. Restarting colima resolves this issue.
-- 
GitLab