sudo docker kill guac-postgres

sudo docker rm guac-postgres

sudo docker kill guac-guac

sudo docker rm guac-guac

sudo docker kill guac-guacd

sudo docker rm guac-guacd

sudo docker kill nginx

sudo docker rm nginx


sudo docker run --rm guacamole/guacamole \
  /opt/guacamole/bin/initdb.sh \
  --postgres > /root/guacamole/initdb.sql

sudo docker run -d --net=mac_net --ip=10.0.10.22 \
    -v /root/guacamole/initdb.sql:/docker-entrypoint-initdb.d/initdb.sql \
    -v /root/guacamole/scripts/:/guac_scripts/ \
    -e POSTGRES_PASSWORD=6777hhhsgg \
    --name guac-postgres \
    -u postgres \
    -d postgres

sudo docker run --rm guacamole/guacamole \
    cat /opt/guacamole/postgresql/schema/001-create-schema.sql \
    > /root/guacamole/scripts/001-create-schema.sql \

sudo docker run --rm guacamole/guacamole \
    cat /opt/guacamole/postgresql/schema/002-create-admin-user.sql \
    > /root/guacamole/scripts/002-create-admin-user.sql

sudo docker exec guac-postgres /bin/bash /guac_scripts/create_db.sh

sudo docker run --net=mac_net --ip=10.0.10.21 \
    -e SERVER_CERTIFICATE=/etc/ssl/certs/fullchain.pem \
    -e SERVER_KEY=/etc/ssl/private/privkey.pem \
    -v /root/ssl:/etc/ssl/certs/   \
    -p 22:22 \
    -p 5900:5900 \
    -p 3389:3389 \
    -p 4822:4822 --name guac-guacd -d guacamole/guacd

sudo docker run --net=mac_net --ip=10.0.10.20 \
    -p 8080:8080 \
    -p 22:22 \
    -p 5900:5900 \
    -p 3389:3389 \
    -v /root/guacamole/home:/opt/guacamole/guac_home   \
    -v /root/guacamole/'Guacamole Packages'/
    -e GUACAMOLE_HOME=/opt/guacamole/guac_home   \
    -e POSTGRES_HOSTNAME=10.0.10.22 \
    -e POSTGRES_DATABASE=guac_db \
    -e POSTGRES_USER=admin \
    -e POSTGRES_PASSWORD=6777hhhsgg \
    -e LDAP_HOSTNAME=10.0.12.5   \
    -e LDAP_PORT=389    \
    -e LDAP_ENCRYPTION_METHOD=none   \
    -e LDAP_USER_BASE_DN=dc=ratchfordconsulting,dc=com   \
    -e LDAP_USERNAME_ATTRIBUTE=sAMAccountName \
    -e LDAP_SEARCH_BIND_DN=cn=svc_guac,ou=Guacamole_Users,dc=ratchfordconsulting,dc=com  \
    -e LDAP_SEARCH_BIND_PASSWORD=Thispasswordsucks2 \
    -e GUACD_HOSTNAME=10.0.10.21 \
    -e GUACD_PORT=4822  \
    -e totp-issuer="RatchfordConsulting.com" \
    -e totp-digits=6 \
    -e totp-period=60 \
    -e totp-mode=sha256 \
    -d --name guac-guac -d guacamole/guacamole

sudo docker run --network="mac_net" --ip=10.0.10.10 --name nginx --hostname nginx \
    -v /root/nginx/www:/usr/share/nginx/html \
    -v /root/nginx/conf/:/etc/nginx/conf.d/ \
    -v /root/nginx/conf/dhparam.pem:/etc/ssl/certs/dhparam.pem \
    -p 80:80 \
    -p 8080:8080 \
    -p 443:443 \
    -d nginx

sudo docker exec -it nginx apt update
