-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsokoban
executable file
·42 lines (38 loc) · 948 Bytes
/
sokoban
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
38
39
40
41
42
#!/usr/bin/env bash
export docker_image="node-runtime:centos"
export http_port=8080
export debug_port=5858
export container_instance="node-server"
start_run_container() {
docker run --rm \
--name $container_instance \
-p $http_port:$http_port \
-p $debug_port:$debug_port \
-v $PWD/src:/src $docker_image $1
}
show_help() {
cat << EOF
Usage: sokoban COMMAND
Command:
run Run node server container
debug Run node server container with debug option
stop Stop running container
shell Login into container shell
build Build docker image
EOF
}
case $1 in
run) start_run_container "/bin/bash bin/run.sh"
;;
debug) start_run_container "/bin/bash bin/debug.sh"
;;
stop) docker stop $container_instance
;;
shell) docker run -it --rm -v $PWD/src:/src $docker_image bash
;;
build) docker build -t $docker_image .
;;
*) show_help
;;
esac
#$SHELL "bin/$1.sh"