diff --git a/docker-build b/docker-build
index d7b4c49..a41b38d 100755
--- a/docker-build
+++ b/docker-build
@@ -1,13 +1,5 @@
#!/bin/bash
-SUV_ID=$(hexdump -vn8 -e'2/4 "%08x" 1 "\n"' /dev/urandom)
-SUV_NAME=i-0$SUV_ID
-
-echo "Building SUV $SUV_NAME ..."
-
-# *** DO NOT REMOVE THE FIRST DOT ***
-SUV_DOMAINNAME=".privatesuv.com"
-
# build the image (i.e. 'mocha suv init' )
docker build -t mocha-httpd -f mocha-suv/docker/Dockerfile .
@@ -18,16 +10,16 @@ if [ $? -ne 0 ]; then
fi
-docker network create --driver=bridge --subnet=10.7.0.0/16 --ip-range=10.7.0.0/24 --gateway=10.7.0.1 mocha-docker
+NETWORK_NAME=mocha-docker
+NETWORK_SUBNET=10.7
+
+NETWORK_EXISTS=$(docker network ls | grep $NETWORK_NAME)
+if [ "$NETWORK_EXISTS" == "" ]; then
+
+ docker network create --driver=bridge --subnet=$NETWORK_SUBNET.0.0/16 --ip-range=$NETWORK_SUBNET.0.0/24 --gateway=$NETWORK_SUBNET.0.1 $NETWORK_NAME
+
+fi
# initiate a container (i.e. 'mocha suv up i-0...' )
# docker run --name $SUV_NAME -d -p 8000:80 --net mocha-docker mocha-httpd # -p 8000:80 mocha-httpd
-# docker inspect $SUV_NAME
-# SUV_IP=$(docker container exec $SUV_NAME hostname -i)
-
-# echo "Enter administrative password to add entry to /etc/hosts file if wanted"
-# echo -e "$SUV_IP\t\t$SUV_NAME$SUV_DOMAINNAME" | sudo tee -a /etc/hosts
-
-# echo "$SUV_NAME : $SUV_IP"
-
diff --git a/docker-rm b/docker-rm
new file mode 100755
index 0000000..9f9678c
--- /dev/null
+++ b/docker-rm
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+NAMES=$(docker container ls -a --format '{{.Names}}' | grep i-0)
+
+for NAME in $NAMES; do
+
+ echo $NAME
+ docker container rm -f $NAME
+
+done
+
+
diff --git a/docker-run b/docker-run
old mode 100644
new mode 100755
index 6e9e5f4..5815bf5
--- a/docker-run
+++ b/docker-run
@@ -1,9 +1,9 @@
#!/bin/bash
-./docker-build
-
USE_SSL=false
+./docker-build
+
Q=$?
if [ $Q -ne 0 ]; then
@@ -32,6 +32,8 @@ if [ $? -ne 0 ]; then
fi
SUV_NAME=i-0$SUV_ID
+SUV_DOMAINNAME=.privatesuv.com
+
echo "provisioning new Docker-based SUV with id $SUV_NAME"
if [ $? -ne 0 ]; then
@@ -45,7 +47,7 @@ fi
docker network create --subnet=10.8.0.0/16 mocha-docker
# initiate a container (i.e. 'mocha suv up i-0...' )
-if [ $PORT_FORWARD != "" ]; then
+if [ "$PORT_FORWARD" != "" ]; then
if [ "$USE_SSL" == "true" ]; then
@@ -64,4 +66,18 @@ fi
echo "waiting for network to settle..."
sleep 3
-docker inspect $SUV_NAME
+# docker inspect $SUV_NAME
+SUV_IP=$(docker container exec $SUV_NAME hostname -i)
+
+if [ $? -ne 0 ]; then
+
+ echo "Something went wrong; please check your configuration"
+
+else
+
+ echo "Enter administrative password to add entry to /etc/hosts file if wanted"
+ echo -e "$SUV_IP\t\t$SUV_NAME$SUV_DOMAINNAME" | sudo tee -a /etc/hosts
+
+ echo "$SUV_NAME : $SUV_IP"
+
+fi
diff --git a/mocha-suv/docker/Dockerfile b/mocha-suv/docker/Dockerfile
index 9996eab..48ebe24 100644
--- a/mocha-suv/docker/Dockerfile
+++ b/mocha-suv/docker/Dockerfile
@@ -1,18 +1,29 @@
# FROM httpd
-FROM ubuntu:24.04
+FROM ubuntu
RUN apt update && apt upgrade -y && apt install -y php php-mbstring php-curl php-xml pwgen
-RUN rm /usr/local/apache2/htdocs/index.html
+# RUN rm /usr/local/apache2/htdocs/index.html
+RUN rm /var/www/html/index.html
RUN a2enmod ssl && a2enmod rewrite
RUN service apache2 restart
-COPY mocha-php/mocha-php/src/mocha-php /usr/local/apache2/htdocs/
+# COPY mocha-php/mocha-php/src/mocha-php /usr/local/apache2/htdocs/
+COPY mocha-php/mocha-php/src/mocha-php /var/www/html
+COPY mocha-php/phast/lib/phast/server /var/www/html/lib/phast
+COPY mocha-php/phast/lib/phast/client/scripts /var/www/html/scripts/phast
COPY mocha-suv/common/certs/localhost.crt /etc/ssl/certs
COPY mocha-suv/common/certs/localhost.key /etc/ssl/certs
-COPY mocha-suv/docker/httpd.conf /usr/local/apache2/conf/httpd.conf
-COPY mocha-suv/docker/ports.conf /usr/local/apache2/conf/ports.conf
-COPY mocha-suv/docker/site.conf /usr/local/apache2/conf/site.conf
+# COPY mocha-suv/docker/httpd.conf /usr/local/apache2/conf/httpd.conf
+# COPY mocha-suv/docker/ports.conf /usr/local/apache2/conf/ports.conf
+COPY mocha-suv/docker/ports.conf /etc/apache2/ports.conf
+
+# COPY mocha-suv/docker/site.conf /usr/local/apache2/conf/site.conf
+COPY mocha-suv/docker/site.conf /etc/apache2/sites-available/000-default.conf
+
+EXPOSE 443
+CMD [ "apache2ctl", "-D", "FOREGROUND" ]
+
diff --git a/mocha-suv/docker/site-local.conf b/mocha-suv/docker/site-local.conf
new file mode 100644
index 0000000..eeb3a53
--- /dev/null
+++ b/mocha-suv/docker/site-local.conf
@@ -0,0 +1,18 @@
+
+
+ ServerAdmin webmaster@dummy-host2.example.com
+
+ DocumentRoot "/usr/local/apache2/htdocs"
+ ServerName dummy-host2.example.com
+ ErrorLog "logs/dummy-host2.example.com-error_log"
+ CustomLog "logs/dummy-host2.example.com-access_log" common
+
+
+ AllowOverride all
+
+
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/certs/localhost.crt
+ SSLCertificateKeyFile /etc/ssl/certs/localhost.key
+
+
diff --git a/mocha-suv/docker/site.conf b/mocha-suv/docker/site.conf
index 18d0c04..77b8fb7 100644
--- a/mocha-suv/docker/site.conf
+++ b/mocha-suv/docker/site.conf
@@ -1,12 +1,13 @@
ServerAdmin webmaster@dummy-host2.example.com
- DocumentRoot "/usr/local/apache2/htdocs"
- ServerName dummy-host2.example.com
- ErrorLog "logs/dummy-host2.example.com-error_log"
- CustomLog "logs/dummy-host2.example.com-access_log" common
-
+ DocumentRoot "/var/www/html"
+ ServerName dummy-host2.example.com
+ # ErrorLog "logs/dummy-host2.example.com-error_log"
+ # CustomLog "logs/dummy-host2.example.com-access_log" common
+
+
AllowOverride all