forked from shubhvjain/codegreen-prediction-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·37 lines (27 loc) · 1.21 KB
/
setup.sh
File metadata and controls
executable file
·37 lines (27 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
docker_image="codegreen-prediction-tool"
container_name="codegreen-prediction-tool"
config_file=".config"
if [ -e "$config_file" ]; then
# Load environment variables from the .config file
source "$config_file"
echo "Config file loaded"
else
echo "Error: $config_file file does not exist."
exit 1
fi
echo "====Building docker image===="
docker build -t codegreen-prediction-tool .
echo "====Creating a new container===="
if docker ps -a --format "{{.Names}}" | grep -q "^$container_name$"; then
docker stop "$container_name" && docker rm "$container_name"
echo "Container $container_name has been stopped and removed."
else
echo "Container $container_name does not exist."
fi
docker create --name "$container_name" -v "$PREDICTIONS_DOCKER_VOLUME_PATH:/app/data" "$docker_image"
docker network connect "$GREENERAI_DOCKER_NETWORK" "$container_name"
# echo "docker run --network greenerai_default --name $container_name -v $PREDICTIONS_DOCKER_VOLUME_PATH:/app/data $docker_image"
# docker compose build
# docker run --name "$container_name" --network "greenerai" -v "$PREDICTIONS_DOCKER_VOLUME_PATH:/app/data" "$docker_image"
# docker network connect greenerai "$container_name"