You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
IMAGE_NAME="phc/storage"
|
|
|
|
CONTAINER_NAME="storage"
|
|
|
|
|
|
|
|
HOST_PORT="4000"
|
|
|
|
|
|
|
|
git pull
|
|
|
|
docker build -t "$IMAGE_NAME" .
|
|
|
|
|
|
|
|
# Tries to remove the previous container
|
|
|
|
docker stop "$CONTAINER_NAME" || true
|
|
|
|
docker rm "$CONTAINER_NAME" || true
|
|
|
|
|
|
|
|
# Starts the new container
|
|
|
|
docker run -d \
|
|
|
|
--name "$CONTAINER_NAME" \
|
|
|
|
--restart unless-stopped \
|
|
|
|
-p "$HOST_PORT:4000" \
|
|
|
|
--privileged \
|
|
|
|
-v /proc:/proc \
|
|
|
|
-v /dev:/dev \
|
|
|
|
-v /:/mnt/space:ro \
|
|
|
|
-v /data-home:/mnt/data-home:ro \
|
|
|
|
-v "$(pwd)/buckets.local:/buckets" \
|
|
|
|
-v "$(pwd)/database.local.json:/app/database.local.json" \
|
|
|
|
"$IMAGE_NAME"
|