Spaces:
Running
Running
Download update_container.sh from xenecode/Jaguar_Project: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/update_container.sh
- Command line
-
hf download hf://spaces/xenecode/Jaguar_Project/update_container.sh
-
curl -L -o update_container.sh https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/update_container.sh
1.11 kB
| # Container, image ve network isimleri | |
| CONTAINER_NAME="fair_container" | |
| IMAGE_NAME="fair:latest" | |
| NETWORK_NAME="fairino-net" | |
| SUBNET="172.17.0.0/24" | |
| GATEWAY="172.17.0.1" | |
| # # Network kontrol ve oluşturma | |
| # if ! docker network inspect $NETWORK_NAME >/dev/null 2>&1; then | |
| # echo "Creating Docker network $NETWORK_NAME..." | |
| # docker network create \ | |
| # --driver bridge \ | |
| # --subnet $SUBNET \ | |
| # --gateway $GATEWAY \ | |
| # $NETWORK_NAME | |
| # else | |
| # echo "Docker network $NETWORK_NAME already exists." | |
| # fi | |
| echo "Stopping existing container (if any)..." | |
| docker stop $CONTAINER_NAME 2>/dev/null | |
| docker rm $CONTAINER_NAME 2>/dev/null | |
| echo "Building new image..." | |
| docker build -t $IMAGE_NAME . | |
| echo "Starting container..." | |
| # frontend/build varsa container'daki hazır build yerine onu sun | |
| FRONTEND_MOUNT="" | |
| if [ -d "$(pwd)/frontend/build" ]; then | |
| echo "Serving frontend/build from host" | |
| FRONTEND_MOUNT="-v $(pwd)/frontend/build:/app/static/react" | |
| fi | |
| docker run \ | |
| -p 7860:7860 \ | |
| $FRONTEND_MOUNT \ | |
| --name $CONTAINER_NAME \ | |
| $IMAGE_NAME | |
| echo "Done!" |