zkt26/z1/prepare-app.sh
2026-04-01 06:53:48 +02:00

24 lines
798 B
Bash

#!/bin/bash
set -e
echo "Preparing app..."
if docker compose version > /dev/null 2>&1; then
echo " Using docker compose to build image..."
docker compose build
else
echo " Using plain docker to build image..."
docker build -t diary-app:latest .
docker network create diary_network 2>/dev/null || echo " Network diary_network already exists, skipping."
docker volume create postgres_data 2>/dev/null || echo " Volume postgres_data already exists, skipping."
docker volume create diary_static 2>/dev/null || echo " Volume diary_static already exists, skipping."
fi
echo ""
echo "Preparation complete."
echo " Image : diary-app:latest"
echo " Network: diary_network"
echo " Volumes: postgres_data, diary_static"
echo ""
echo "Run ./start-app.sh to start the application."