\chapter{DigitalOcean Docker Deployment} \ChapterLabel{DigitalOceanDockerDeployment} \index{DigitalOcean!Docker deployment} \index{Docker!Ubuntu installation} \section{Overview} The team created an Ubuntu Droplet in the DigitalOcean project named \textit{SSW 590 DevOps}. The Droplet is currently named \texttt{ssw590-group7-droplet} and has one virtual CPU, 1 GB of RAM, 25 GB of disk space, and the public IP address \href{http://142.93.193.110}{142.93.193.110}. Docker Engine was then installed on the Droplet by following Docker's official Ubuntu installation instructions \cite{DockerUbuntuInstall}. Figure~\ref{fig:digitalocean-droplet} preserves the original pre-upgrade cloud-console view; the text and host registry record the current name and capacity. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth]{digitalocean-droplet.png} \caption{Original pre-upgrade view of the Ubuntu Droplet in the SSW 590 DevOps project; the current resource is named \texttt{ssw590-group7-droplet} with 1 GB RAM and 25 GB storage.} \label{fig:digitalocean-droplet} \end{figure} \FloatBarrier \section{Installing Docker Engine on Ubuntu} The package index was updated, the required certificate and download utilities were installed, and Docker's official GPG key was saved in the APT keyring. \begin{minted}{bash} sudo apt update sudo apt install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc \end{minted} The Docker repository was then added to the Ubuntu APT sources. The suite and architecture values were determined automatically from the operating system. \begin{minted}{bash} sudo tee /etc/apt/sources.list.d/docker.sources < this.changeBackground()); } } const blueButton = new ColorButtonController("blueBtn", "blue"); const redButton = new ColorButtonController("redBtn", "red"); blueButton.bind(); redButton.bind(); \end{minted} The HTML loads the class-based script after defining both buttons. \begin{minted}{html} \end{minted} \subsection{UML Class Diagram} Figure~\ref{fig:color-button-uml} shows the updated object-oriented design. The minus sign indicates private implementation data and the plus sign indicates public operations. The same class is instantiated once for the Blue button and once for the Red button. \begin{figure}[htbp] \centering \begin{tikzpicture}[ uml/.style={draw=black, rounded corners=1pt, align=left, inner sep=0pt, text width=10.5cm, font=\small} ] \node[uml] (class) {% \begin{minipage}{10.5cm} \centering\textbf{ColorButtonController}\\[-2pt] \rule{\linewidth}{0.4pt} \raggedright $-$ button: HTMLButtonElement\\ $-$ color: string\\[-2pt] \rule{\linewidth}{0.4pt} $+$ ColorButtonController(buttonId: string, color: string)\\ $+$ bind(): void\\ $+$ changeBackground(): void \end{minipage} }; \end{tikzpicture} \caption{UML class diagram for the class-based two-button website.} \label{fig:color-button-uml} \end{figure} \FloatBarrier \subsection{Build and Deployment} The image was rebuilt as \texttt{color-buttons-app}; container port 3000 was published through host port 8080. The existing container must be stopped and removed before the revised image is deployed with the same container name. \begin{minted}{bash} cd color-buttons-app sudo docker build -t color-buttons-app . sudo docker stop color-buttons-app sudo docker rm color-buttons-app sudo docker run -d --name color-buttons-app -p 8080:3000 color-buttons-app sudo docker ps \end{minted} The historical two-button endpoint (public port now closed) was \href{http://142.93.193.110:8080}{http://142.93.193.110:8080}. Clicking either button calls its controller instance and changes the page background to the corresponding color. \section{Deployment Summary} The completed work for Steps 1 through 3 establishes a repeatable cloud deployment workflow: provision the Ubuntu Droplet, install Docker from its official APT repository, build each application image, run the containers with published ports, implement reusable class-based client behavior, and confirm container status with \texttt{docker ps}.