3-service Docker app: Nginx frontend, Flask REST API backend, PostgreSQL database. Includes lifecycle scripts (prepare, start, stop, remove), docker-compose.yaml, and documentation.
20 lines
528 B
Bash
20 lines
528 B
Bash
#!/bin/bash
|
|
echo "Preparing app..."
|
|
|
|
# Build Docker images
|
|
echo "Building backend image..."
|
|
docker build -t taskapp-backend ./backend
|
|
|
|
echo "Building frontend image..."
|
|
docker build -t taskapp-frontend ./frontend
|
|
|
|
# Create network (ignore error if it already exists)
|
|
echo "Creating network..."
|
|
docker network create taskapp-network 2>/dev/null || true
|
|
|
|
# Create named volume (ignore error if it already exists)
|
|
echo "Creating volume..."
|
|
docker volume create taskapp-pgdata 2>/dev/null || true
|
|
|
|
echo "App prepared successfully."
|