Update justfile and docker-compose for improved production workflow

- Added image reference for the app in docker-compose.yml.
- Modified justfile to include new push and prod-pull commands for building and deploying the app image.
- Updated prod-up command to pull the latest image before starting containers, enhancing deployment efficiency.
This commit is contained in:
Maxim Snesarev 2026-04-03 02:32:47 +03:00
parent 63e619eab6
commit d8ef285f15
2 changed files with 16 additions and 3 deletions

View File

@ -45,6 +45,7 @@ services:
"
app:
image: git.oberonworks.ru/oberon/advdoors:latest
build:
context: ..
dockerfile: docker/Dockerfile

View File

@ -2,6 +2,7 @@ set dotenv-load := false
dev_compose := "docker/docker-compose.dev.yml"
prod_compose := "docker/docker-compose.yml"
image := "git.oberonworks.ru/oberon/advdoors:latest"
# List available recipes
default:
@ -80,9 +81,10 @@ db-reset:
docker compose -f {{dev_compose}} up -d
@echo "Database and MinIO volumes wiped. Restart dev server to re-create schema."
# Production: build and start all containers
# Production: pull latest image and start all containers
prod-up:
docker compose -f {{prod_compose}} up -d --build
docker compose -f {{prod_compose}} pull app
docker compose -f {{prod_compose}} up -d
# Production: stop
prod-down:
@ -92,6 +94,16 @@ prod-down:
prod-logs *args:
docker compose -f {{prod_compose}} logs {{args}}
# Build app image and push to Gitea registry
push:
docker compose -f {{prod_compose}} build app
docker compose -f {{prod_compose}} push app
# Production: pull latest image and restart app
prod-pull:
docker compose -f {{prod_compose}} pull app
docker compose -f {{prod_compose}} up -d app
# Show status of dev services
status:
docker compose -f {{dev_compose}} ps