-
-
Notifications
You must be signed in to change notification settings - Fork 0
[DB] Production Ready #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3f9fc10
use alpine
gocanto f7f3238
add secrets
gocanto fe202cd
wip
gocanto a81a80d
wip
gocanto a817b37
wip
gocanto a615019
agnostic db creds
gocanto 07dbf3e
clear db makefile
gocanto ae7c559
typo
gocanto c26d1cc
PHONY
gocanto 4d469bf
format
gocanto 6541fcf
we do not use local data anymore
gocanto f516152
fix host
gocanto 6cd5b96
fresh
gocanto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| # --- [API]: Root | ||
| .env | ||
| .env.production | ||
| database/infra/data | ||
| tmp | ||
|
|
||
| # --- [API]: Storage | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,83 +1,66 @@ | ||
| # --- Metadata | ||
| .PHONY: db\:local db\:up db\:ping db\:bash db\:fresh db\:logs | ||
| .PHONY: db\:delete db\:secure db\:secure\:show db\:chmod db\:seed | ||
| .PHONY: db\:migrate db\:rollback db\:migrate\:create db\:migrate\:force | ||
| .PHONY: db\:sh db\:up db\:down db\:logs db\:bash db\:fresh | ||
| .PHONY: db\:secure db\:seed db\:migrate db\:migrate\:create db\:migrate\:force db\:rollback | ||
|
|
||
| # --- Docker | ||
| DB_DOCKER_SERVICE_NAME := "api-db" | ||
| # --- Docker Services | ||
| DB_DOCKER_SERVICE_NAME := api-db | ||
| DB_DOCKER_CONTAINER_NAME := oullin_db | ||
| DB_MIGRATE_SERVICE_NAME := api-db-migrate | ||
|
|
||
| # --- Paths | ||
| # Define root paths for clarity. Assume ROOT_PATH is exported or defined. | ||
| DB_SEEDER_ROOT_PATH := $(ROOT_PATH)/database/seeder | ||
| DB_INFRA_ROOT_PATH := $(ROOT_PATH)/database/infra | ||
| DB_INFRA_SSL_PATH := $(DB_INFRA_ROOT_PATH)/ssl | ||
| DB_INFRA_DATA_PATH := $(DB_INFRA_ROOT_PATH)/data | ||
| DB_INFRA_SCRIPTS_PATH := $(DB_INFRA_ROOT_PATH)/scripts | ||
|
|
||
| # --- SSL | ||
| # --- SSL Certificate Files | ||
| DB_INFRA_SERVER_CRT := $(DB_INFRA_SSL_PATH)/server.crt | ||
| DB_INFRA_SERVER_CSR := $(DB_INFRA_SSL_PATH)/server.csr | ||
| DB_INFRA_SERVER_KEY := $(DB_INFRA_SSL_PATH)/server.key | ||
|
|
||
| # --- Migrations | ||
| DB_MIGRATE_PATH := $(DB_INFRA_ROOT_PATH)/migrations | ||
| DB_MIGRATE_VOL_MAP := $(DB_MIGRATE_PATH):$(DB_MIGRATE_PATH) | ||
|
|
||
| db\:local: | ||
| # --- Works with your local PG installation. | ||
| cd $(EN_DB_BIN_DIR) && \ | ||
| ./psql -h $(ENV_DB_HOST) -U $(ENV_DB_USER_NAME) -d $(ENV_DB_DATABASE_NAME) -p $(ENV_DB_PORT) | ||
|
|
||
| db\:seed: | ||
| go run $(DB_SEEDER_ROOT_PATH)/main.go | ||
| db\:sh: | ||
| chmod +x $(DB_INFRA_SCRIPTS_PATH)/healthcheck.sh | ||
| chmod +x $(DB_INFRA_SCRIPTS_PATH)/run-migration.sh | ||
|
|
||
| db\:up: | ||
| docker compose up $(DB_DOCKER_SERVICE_NAME) -d && \ | ||
| make db:logs | ||
| docker compose up $(DB_DOCKER_SERVICE_NAME) -d | ||
|
|
||
| db\:down: | ||
| docker compose stop $(DB_DOCKER_SERVICE_NAME) | ||
|
|
||
| db\:ping: | ||
| docker port $(DB_DOCKER_CONTAINER_NAME) | ||
| db\:logs: | ||
| docker logs -f $(DB_DOCKER_CONTAINER_NAME) | ||
|
|
||
| db\:bash: | ||
| docker exec -it $(DB_DOCKER_CONTAINER_NAME) bash | ||
|
|
||
| db\:fresh: | ||
| make db:delete && make db:up | ||
|
|
||
| db\:logs: | ||
| docker logs -f $(DB_DOCKER_CONTAINER_NAME) | ||
| make db:delete | ||
| make db:up | ||
|
|
||
| db\:delete: | ||
| docker compose down $(DB_DOCKER_SERVICE_NAME) --remove-orphans && \ | ||
| sudo rm -rf $(DB_INFRA_DATA_PATH) && \ | ||
| docker ps | ||
| docker compose down -v --remove-orphans | ||
|
|
||
| db\:secure: | ||
| rm -rf $(DB_INFRA_SERVER_CRT) && rm -rf $(DB_INFRA_SERVER_CSR) && rm -rf $(DB_INFRA_SERVER_KEY) && \ | ||
| openssl genpkey -algorithm RSA -out $(DB_INFRA_SERVER_KEY) && \ | ||
| openssl req -new -key $(DB_INFRA_SERVER_KEY) -out $(DB_INFRA_SERVER_CSR) && \ | ||
| openssl x509 -req -days 365 -in $(DB_INFRA_SERVER_CSR) -signkey $(DB_INFRA_SERVER_KEY) -out $(DB_INFRA_SERVER_CRT) && \ | ||
| make db:chmod | ||
|
|
||
| db\:chmod: | ||
| sudo chmod 600 $(DB_INFRA_SERVER_KEY) && sudo chmod 644 $(DB_INFRA_SERVER_CRT) | ||
| rm -f $(DB_INFRA_SERVER_CRT) $(DB_INFRA_SERVER_CSR) $(DB_INFRA_SERVER_KEY) | ||
| openssl genpkey -algorithm RSA -out $(DB_INFRA_SERVER_KEY) | ||
| openssl req -new -key $(DB_INFRA_SERVER_KEY) -out $(DB_INFRA_SERVER_CSR) -subj "/CN=oullin-db-ssl" | ||
| openssl x509 -req -days 365 -in $(DB_INFRA_SERVER_CSR) -signkey $(DB_INFRA_SERVER_KEY) -out $(DB_INFRA_SERVER_CRT) | ||
|
|
||
| db\:secure\:show: | ||
| docker exec -it $(DB_DOCKER_CONTAINER_NAME) ls -l /etc/ssl/private/server.key && \ | ||
| docker exec -it $(DB_DOCKER_CONTAINER_NAME) ls -l /etc/ssl/certs/server.crt | ||
| db\:seed: | ||
| go run $(DB_SEEDER_ROOT_PATH)/main.go | ||
|
|
||
| # -------------------------------------------------------------------------------------------------------------------- # | ||
| # --- Migrations | ||
| # -------------------------------------------------------------------------------------------------------------------- # | ||
| db\:migrate: | ||
| @printf "\n$(BLUE)[DB]$(NC) Migration has started.\n" | ||
| @docker run -v $(DB_MIGRATE_VOL_MAP) --network $(ROOT_NETWORK) migrate/migrate -verbose -path=$(DB_MIGRATE_PATH) -database $(ENV_DB_URL) up | ||
| @printf "$(GREEN)[DB]$(NC) Migration has finished.\n\n" | ||
| docker-compose run --rm $(DB_MIGRATE_SERVICE_NAME) up | ||
|
|
||
| db\:rollback: | ||
| @printf "\n$(RED)[DB]$(NC) Migration rollback has started.\n" | ||
| @docker run -v $(DB_MIGRATE_VOL_MAP) --network $(ROOT_NETWORK) migrate/migrate -verbose -path=$(DB_MIGRATE_PATH) -database $(ENV_DB_URL) down 1 | ||
| @printf "$(GREEN)[DB]$(NC) Migration rollback has finished.\n\n" | ||
| docker-compose run --rm $(DB_MIGRATE_SERVICE_NAME) down 1 | ||
|
|
||
| # --- Migrations | ||
| db\:migrate\:create: | ||
| docker run -v $(DB_MIGRATE_VOL_MAP) --network $(ROOT_NETWORK) migrate/migrate create -ext sql -dir $(DB_MIGRATE_PATH) -seq $(name) | ||
| docker-compose run --rm $(DB_MIGRATE_SERVICE_NAME) create -ext sql -dir /migrations -seq $(name) | ||
|
|
||
| db\:migrate\:force: | ||
| docker run -v $(DB_MIGRATE_VOL_MAP) --network $(ROOT_NETWORK) migrate/migrate migrate -path $(DB_MIGRATE_PATH) -database $(ENV_DB_URL) force $(version) | ||
| docker-compose run --rm $(DB_MIGRATE_SERVICE_NAME) force $(version) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Exit immediately if any command fails. | ||
| set -e | ||
|
|
||
| # Read the secrets into variables. This is more robust than direct command substitution. | ||
| DB_USER=$(cat /run/secrets/postgres_user) | ||
| DB_NAME=$(cat /run/secrets/postgres_db) | ||
|
|
||
| # Explicitly check if the user variable is empty. If it is, fail immediately. | ||
| # This prevents the "role -d does not exist" error. | ||
| if [ -z "$DB_USER" ]; then | ||
| echo "Healthcheck Error: The postgres_user secret is empty or could not be read." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Execute the final command. 'exec' replaces the shell process, which is slightly more efficient. | ||
| # The variables are double-quoted to handle any special characters safely. | ||
| exec pg_isready -U "$DB_USER" -d "$DB_NAME" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Exit immediately if a command exits with a non-zero status. | ||
| set -e | ||
|
|
||
| # Read the credentials from the Docker Secret files | ||
| DB_USER=$(cat /run/secrets/postgres_user) | ||
| DB_PASSWORD=$(cat /run/secrets/postgres_password) | ||
| DB_NAME=$(cat /run/secrets/postgres_db) | ||
|
|
||
| # Construct the database URL using the values from the secrets | ||
| DATABASE_URL="postgres://${DB_USER}:${DB_PASSWORD}@api-db:5432/${DB_NAME}?sslmode=disable" | ||
|
|
||
| # Execute the migrate tool, passing the constructed URL and any other arguments | ||
| # The "$@" passes along any arguments from the docker-compose command (like "up", "down 1", etc.) | ||
| migrate -path /migrations -database "${DATABASE_URL}" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| oullin_db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| gocanto-password | ||
gocanto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| gocanto-user | ||
gocanto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,18 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIDXzCCAkegAwIBAgIUWxAMKcyluk3SNEt4TcADDjHJXkIwDQYJKoZIhvcNAQEL | ||
| BQAwWDELMAkGA1UEBhMCU0cxEjAQBgNVBAgMCVNpbmdhcG9yZTESMBAGA1UEBwwJ | ||
| U2luZ2Fwb3JlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcN | ||
| MjUwN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----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,15 @@ | ||
| -----BEGIN CERTIFICATE REQUEST----- | ||
| MIICnTCCAYUCAQAwWDELMAkGA1UEBhMCU0cxEjAQBgNVBAgMCVNpbmdhcG9yZTES | ||
| MBAGA1UEBwwJU2luZ2Fwb3JlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0 | ||
| eSBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDE4r+HUS7gEMQ0 | ||
| 56hqTbG81XKVERUFVT6zB4dDRK5ftpRSV9E7BU/kR8me7yxyHQ2ZpfqttMHI0rn5 | ||
| ntaPTesX0ILpUf4CAtvtt50WZt+Og43pZ/I6yl7oXIaib1yeZCR6Iar6mpCXGa/d | ||
| e3Qj4AI/PjotW9G6ir3PRBZo/9dxNQjYP/d0mTGf2+bCrG+ZS56xaz498zkNNLPJ | ||
| 7B2ynIK6EKp9v/n7gflbKr1iDj73N4afizVt6CgfO0maLqfAXIphbdNNdHR1tNZp | ||
| 1MBMlkCmGwFt16O1SBvJ15a2HZ1ca0xTCxXyB+KL8vfyHKUC42PJE4QziaRTJ5RB | ||
| I7GTOG/PAgMBAAGgADANBgkqhkiG9w0BAQsFAAOCAQEAw3nsoZiDVo7JxZu3fopX | ||
| 7Ms/mV+BC9eEchwfxoYb5wxP3N59FJyeD6EgBXl95D+64JYUPN3eJKR8y5oZdmPb | ||
| I+W8zsYR2j49KYl4ml5enP516LG4eeraoHxYk8P/4ediOpNqHqi5cSx8S2/WCs8E | ||
| zXj36eVgJ5JkvRqRIVJwN97GM25/jkRYKd7bgDS/rsZrx4GZ9zjtHwNWO2cqGlNR | ||
| uTcxZmq6rDwFY9y6OAyB7C+7RdtbpX7tWVLVEg/Jhe18nR6fBYuo7WQzM6TUt/B7 | ||
| IZsABy6wllGEq3TpKJcfgJWQfO97kiS5BQM9AKGsViPEa/XyKxX+5JbHliQ3K9ci | ||
| oA== | ||
| MIICXTCCAUUCAQAwGDEWMBQGA1UEAwwNb3VsbGluLWRiLXNzbDCCASIwDQYJKoZI | ||
| hvcNAQEBBQADggEPADCCAQoCggEBALdw+GW3I1pCzhYxxkjuIDDAIa8mmpWnZ2GR | ||
| wCemIBoyYOtn2H1SaO7KRuwtndFfwUKDbjHz71LFDviFAIzG+15fMvEuJp8DYmw5 | ||
| nGjnnbmgXqfdpDhcvOAYKEY3TcOTBtR9JWwOSdQZySBgQXm1bDEWwiPV2pQPtgq5 | ||
| /XzUOA0G7aLrmclUXKSmtKC14ZaFhfmP4skt/rMyB22hLBASGnD4GYmGkUO3I6Zj | ||
| ORn8UEyoDBczBwFe7Ch1BL2OO7glWtf/B4lo7w08qRBS49Wxah7jYpHJrHwWXskC | ||
| z290YSY2JHyYeN5+ZdD1279kUrnHyUaCwLbDVfHP0oyYpEr6cuUCAwEAAaAAMA0G | ||
| CSqGSIb3DQEBCwUAA4IBAQAAxwg4Y2e16tACOm4iFETAkT7zhmZHG3zWiXPrTM5a | ||
| kSGGbQNkbpCqBxB+8V6PEXOUVI7CwSz7O/qq46Y4Py+qHwjhH2NKSUiXuAne92Z7 | ||
| FKawYaK8LLafISZrGl/FfUE9wIyILnYfKl/RJa21Rj66nZlUfbVhA8NfIeHHz5Am | ||
| Gma8LEkhPt4cX6fdEsw6fsyGOpxc3WAoEk73p0AjahvnyS5MFINasftvdAs1H8ef | ||
| 8wgIQbVblS+NSwcDc3hnSsm9itdcmzG6hpyD1aaJkX7Y/+zWJnhyW6EEVPJWGqNj | ||
| c4ENieqTtCOWKG1fV/tRd2UpGT2T95+2JpJISD26TPcJ | ||
| -----END CERTIFICATE REQUEST----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,28 @@ | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDE4r+HUS7gEMQ0 | ||
| 56hqTbG81XKVERUFVT6zB4dDRK5ftpRSV9E7BU/kR8me7yxyHQ2ZpfqttMHI0rn5 | ||
| ntaPTesX0ILpUf4CAtvtt50WZt+Og43pZ/I6yl7oXIaib1yeZCR6Iar6mpCXGa/d | ||
| e3Qj4AI/PjotW9G6ir3PRBZo/9dxNQjYP/d0mTGf2+bCrG+ZS56xaz498zkNNLPJ | ||
| 7B2ynIK6EKp9v/n7gflbKr1iDj73N4afizVt6CgfO0maLqfAXIphbdNNdHR1tNZp | ||
| 1MBMlkCmGwFt16O1SBvJ15a2HZ1ca0xTCxXyB+KL8vfyHKUC42PJE4QziaRTJ5RB | ||
| I7GTOG/PAgMBAAECggEAPQPgQzk/g6TuiU65fKgzSsgDSHsQvqRaV/UfUBN6zqKw | ||
| eIxKhTXyOlac/yoz5fFnA5TSiP6Zh3j2tYsqByMolirCRzhntYvZSGQ8xHKBGZNf | ||
| aVQTV3Db1LrH5pMIavWx8D9600sPQCRvwf2+UlfbmmnYcbIg3uScSh1ZrJSM2cIA | ||
| lifcZfkBlN4/Z7dm09XHcM9+tTmMvc+L5DwYjvmRhNByoFJ0w4kAgDA5I9YTL1mh | ||
| TP7u4ABEt2QG4Yic4T1o0pc/dbSGqCYSdizyow6ybtUCScIp1kOKZNdLt8PX+E2m | ||
| ZrOVIUHiLdJhwogmGXWXV/emV49j8CuA0sD/5TNEAQKBgQDmnKgBut406Ef7enld | ||
| jE1baq5YnZsIUI+ex7b+2Um9ivQS0HXF27mZ6uK6wCknWU8D4wZ0oo8bRUUnwAir | ||
| +CTX0e5RJ7AJRFWRtsQNCGUyRR0gANEQ4mE2fzmKdqkGiXFUKV++1EFax4UZ9LnP | ||
| UyPI0GKoMJL2zrC6c4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KBgFf+ | ||
| p00ba80JOxyMRHh/iyg+Ey29nyB3sy6KkezrlUQn4muBicxHaTuMKJzklDZEWrqK | ||
| oOmnT+Qn9aL81qHiNx6QMx2WXZ0xw22uq624rLb57a/xQ/g8hQtDt80OYNjTMG+Y | ||
| Cs2cv6hPRoW/klXLutpxbm2jIQNcVeh/CBoFcinBAoGACQfApcPTA05j8WXfIpla | ||
| VR+lpN9msvArCw3XPkwOMvVGATpTckvutC3wo6QnRaTrlXm1q26hcmElb4Sd32Xn | ||
| KxQt2QpHTfsqi3in/kuqZAKl4l+Ah1Qt5++pTJ8o2bsRA9fqkWr2dSyCB3E3IjbJ | ||
| R3uIEjvEUKqYUCu8SoEQhm4= | ||
| -----END PRIVATE KEY----- | ||
gocanto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix the order of Docker cleanup operations and reduce redundancy.
The current sequence has several issues:
Incorrect order: Lines 13-14 attempt to stop/remove containers AFTER
docker system prunehas already run, making them redundant or potentially problematic.Redundancy:
docker system prune -a --volumes -falready handles most cleanup that the individual prune commands (lines 8-11) perform.Safety concern: These commands affect ALL Docker resources system-wide, not just project-related ones.
Consider this improved sequence:
This simplified version:
📝 Committable suggestion
🤖 Prompt for AI Agents