elemes/start.sh

25 lines
765 B
Bash
Raw Normal View History

2026-01-02 06:18:48 +07:00
#!/bin/bash
# Script to start the C Programming Learning Management System
echo "Starting C Programming Learning Management System..."
# Check if container is already running
2026-01-06 21:38:54 +07:00
if [ "$(podman ps -q -f name=elemes-container)" ]; then
echo "Container is already running. Access the application at http://localhost:5000"
exit 0
2026-01-02 06:18:48 +07:00
fi
# Check if container exists but is stopped
2026-01-06 21:38:54 +07:00
if [ "$(podman ps -aq -f name=elemes-container)" ]; then
echo "Starting existing container..."
podman-compose --env-file ../.env up -d
2026-01-02 06:18:48 +07:00
else
2026-01-06 21:38:54 +07:00
# Build and run the container
echo "Building and starting container..."
podman-compose --env-file ../.env up --build -d
2026-01-02 06:18:48 +07:00
fi
echo "Application is now running. Access at http://localhost:5000"
2026-01-04 18:16:58 +07:00
echo "To stop the application, run: ./stop.sh"