-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinuxLaunchRoundTablerTestingNetwork
61 lines (39 loc) · 1.94 KB
/
LinuxLaunchRoundTablerTestingNetwork
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
docker stop roundtabler-db-1
echo Stopped any existing mariadb docker instances
docker rm roundtabler-db-1
echo Removed any existing mariadb docker instances
docker stop roundtabler-adminer-1
echo Stopped any existing mariadb adminer docker instances
docker rm roundtabler-adminer-1
echo Removed any existing mariadb adminer docker instances
docker stop roundtabler-web-1
echo Stopped any existing mariadb web docker instances
docker rm roundtabler-web-1
echo Removed any existing mariadb web docker instances
docker stop roundtabler
echo Stopped any existing roundtabler instance
docker rm roundtabler
printf "Removed any existing roundtabler instance\n\n"
# Create our network if it does not exist, first testing for existence
# Uses bash behavior similar to short circuiting in other languages
# Pipes output to nowhere since that does not matter, just checking existence
# docker network inspect roundtabler_default >/dev/null 2>&1 || docker network create roundtabler_default
# printf "Created Docker network"
docker compose -f mariadbstack.yml up -d
printf "Started Docker Application stack with Mariadb database and Adminer for Browser connection ability\n"
docker build --tag roundtabler .
echo Docker instance successfully built. Start container?
read -p "Press any key to resume ..."
docker run -d -t --name roundtabler --mount type=bind,source="$(pwd)",target=/RoundTabler roundtabler
printf "\n\n"
docker network connect roundtabler_default roundtabler
echo Added roundtabler container to roundtabler_default
echo To connect to each container using the instance name in place of an IP address
# Compile the program; this should work on any relatively recent distro
docker exec -d -it roundtabler javac ./src/**/*.java ./src/RoundTabler/db/*.java
docker cp ./nginx.conf roundtabler-web-1:/etc/nginx/nginx.conf
printf "\n\n"
echo RoundTabler Testing Network Successfully built.
printf "\n"
read -p "Press any key to complete the process..."