From 31be156be34d8cb48f90fda21e91f78477dc02a8 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 27 Apr 2025 16:31:11 +0000 Subject: [PATCH] Added ssh default for building docker image (#33) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/33 Co-authored-by: phoenix Co-committed-by: phoenix --- READEME.md | 20 -------------------- README.md | 26 ++++++++++++++++++++++++++ docker-compose.yaml | 6 ++++-- docker_run.txt | 13 ------------- 4 files changed, 30 insertions(+), 35 deletions(-) delete mode 100644 READEME.md create mode 100644 README.md delete mode 100644 docker_run.txt diff --git a/READEME.md b/READEME.md deleted file mode 100644 index 5ba9a07..0000000 --- a/READEME.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# Getting started -Take notice of the .env.sample file and create copies without the .sample in the name. - -`.env.sample` -> `.env` - -Ensure that all variables are populated and is correct. - -## Docker - -Build the images -``` -docker compose build --ssh default auth_api -``` - -Bring it up -``` -docker compose up -d --force-recreate auth_api -``` \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b56d1e1 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ + + +# Getting Started +Copy the `.env.sample` file to `.env` and ensure that the variables are populated. This project +can be used with regular hosting or with docker. For the sake of getting up to speed quickly, +Docker will be covered. Make sure docker is running and your ssh identity has been loaded. + +Build image +``` +docker compose build +``` + +Start images +``` +docker compose up -d --force-recreate +``` + +Bring it down +``` +docker compose down -v +``` + +Pruning +``` +docker system prune -a +``` diff --git a/docker-compose.yaml b/docker-compose.yaml index 8dd5162..ed72c2b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,9 @@ version: '3.8' # Use a recent version services: # Your Rust Application Service auth_api: - build: . # Tells docker-compose to build the Dockerfile in the current directory + build: # Tells docker-compose to build the Dockerfile in the current directory + context: . + ssh: ["default"] # Uses host's SSH agent container_name: icarus_auth # Optional: Give the container a specific name ports: # Map host port 8000 to container port 3000 (adjust as needed) @@ -40,4 +42,4 @@ services: # Define the named volume for data persistence volumes: postgres_data: - driver: local # Use the default local driver \ No newline at end of file + driver: local # Use the default local driver diff --git a/docker_run.txt b/docker_run.txt deleted file mode 100644 index 7f319e4..0000000 --- a/docker_run.txt +++ /dev/null @@ -1,13 +0,0 @@ - -# Docker stuff -#Build app -docker compose build --ssh default auth_api - -# Rebuild and bring up -docker compose up -d --force-recreate auth_api - -# Bring it down -docker compose down -v - -# Pruning -docker system prune -a \ No newline at end of file