feat: use DOCKER_IMAGE from .env in Makefile

- Update Makefile to read DOCKER_IMAGE from .env file with proper precedence
- Environment variables override .env file values
- Fallback to 'meds-app:latest' if not defined anywhere
- Add new Docker targets: docker-run, docker-push, docker-config
- Improve help output with environment variable documentation
- Update APP_NAME_CONFIGURATION.md to show Makefile usage examples

Variable precedence:
1. Environment variable (highest)
2. .env file (medium)
3. Default fallback (lowest)
This commit is contained in:
William Valentin
2025-09-08 21:43:02 -07:00
parent 36dcdbd459
commit 518752ab6e
2 changed files with 41 additions and 5 deletions

View File

@@ -25,7 +25,10 @@ make deploy
export APP_NAME="DevMeds"
bun run dev
# For Docker build
# For Docker build with Makefile
DOCKER_IMAGE="myregistry.com/myapp:v1.0" make docker-build
# For Docker build with manual command
APP_NAME="CustomApp" docker build -t myapp .
```
@@ -34,12 +37,15 @@ APP_NAME="CustomApp" docker build -t myapp .
```bash
# .env
APP_NAME=MyCustomApp
DOCKER_IMAGE=myregistry.com/mycustomapp:dev
# .env.production
APP_NAME=ProductionApp
DOCKER_IMAGE=myregistry.com/productionapp:latest
# .env.staging
APP_NAME=StagingApp
DOCKER_IMAGE=myregistry.com/stagingapp:staging
```
## Where APP_NAME is Used