Changes between Version 7 and Version 8 of dockerdeployment2023
- Timestamp:
- Dec 8, 2023, 2:10:48 PM (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
dockerdeployment2023
v7 v8 5 5 1. Update Your System: Ensure your system package database is up-to-date. 6 6 7 ` sudo apt update`7 `sudo apt update` 8 8 9 9 `sudo apt upgrade` … … 11 11 2. Install Docker: Install Docker using the convenience script provided by Docker. 12 12 13 ` 14 15 ` 16 17 3. Add User to Docker Group (Optional): If you wantto run Docker commands without sudo, add your user to the docker group.18 19 ` 13 `curl -fsSL https://get.docker.com -o get-docker.sh` 14 15 `sudo sh get-docker.sh` 16 17 3. Add User to Docker Group: to run Docker commands without sudo, add your user to the docker group. 18 19 `sudo usermod -aG docker ${USER}` 20 20 21 21 Log out and log back in for the group changes to take effect. … … 43 43 6.3 Access the Web Application: If you're accessing the server locally, open a web browser and navigate to: (Since you are connected via SSH lets install a text-based web browser lynx.) 44 44 45 ` 46 47 ` 45 `sudo apt-get install lynx` 46 47 `lynx http://localhost:8080` 48 48 49 49 6.4 Stop and Remove the Web Application (Optional): … … 54 54 ` docker rm sample-webapp` 55 55 56 56 57 Extra Ref: 57 58 58 [https://linuxhint.com/best_linux_text_based_browsers/][] 59 60 [https://linuxhint.com/best_linux_text_based_browsers/] 61 59 62 [https://romanzolotarev.com/ssh.html] 60 63 64 61 65 ==== Basic Docker Commands and Their Usage ==== 62 66 … … 251 255 • `docker-compose logs`: Shows the logs from the services. 252 256 253 '''Deploying WordPress with Docker Compose'''254 255 Let's deploy a WordPress application using two containers: one forWordPress and another for the MySQL database.257 '''Deploying !WordPress with Docker Compose''' 258 259 Let's deploy a !WordPress application using two containers: one for !WordPress and another for the MySQL database. 256 260 Create a docker-compose.yml file: 257 261 … … 291 295 }}} 292 296 293 Start the WordPress and Database Containers: Navigate to the directory containing the `docker-compose.yml` file and run:297 Start the !WordPress and Database Containers: Navigate to the directory containing the `docker-compose.yml` file and run: 294 298 295 299 `docker-compose up -d` 296 300 297 This command will start the services in detached mode. Once the services are up, you can access the WordPress site by navigating to `http://<Floating_IP>:8080` from your browser.301 This command will start the services in detached mode. Once the services are up, you can access the !WordPress site by navigating to `http://<MASTER_IP>:8080` from your browser. 298 302 299 303 Stopping the Services: To stop the services, navigate to the same directory and run: