feat: add Makefile and docker-compose production overlay

This commit is contained in:
2026-01-24 21:21:00 +01:00
parent 624ae45f0a
commit 070af3167d
2 changed files with 40 additions and 3 deletions

View File

@@ -1,5 +1,33 @@
run: stop # === Configuration ===
docker compose up -d # Default value is 'dev'. Can be overridden with 'make ENV=prod ...'
ENV ?= dev
COMPOSE_FILE = docker-compose$(if $(filter $(ENV),prod),.prod,).yml
COMPOSE = docker compose -f $(COMPOSE_FILE)
.PHONY: up stop build deploy logs
# Standard Start (on iMac: 'make run' -> dev | on Pi: 'make ENV=prod run')
run: stop up
up:
$(COMPOSE) up -d
# Build command
build:
$(COMPOSE) build
# The Deployment Routine for your Pi
# You would call this with: make ENV=prod deploy
deploy: stop pull build up clean
pull:
git pull origin main
stop: stop:
docker compose down --remove-orphans $(COMPOSE) down --remove-orphans
logs:
$(COMPOSE) logs -f
clean:
docker image prune -f

9
docker-compose.prod.yml Normal file
View File

@@ -0,0 +1,9 @@
services:
app:
build: .
image: cgr-next-js-prod
volumes: !reset []
command: !reset []
ports:
- "80:3000"
restart: always