Skip to content

Docker Guide

Mohammad edited this page Oct 27, 2024 · 8 revisions

This guide covers how to build, run, and manage Docker containers for Drone World.

Step 1: Prerequisites

Step 2: Setup

Navigate to the Project Root

Before running any Docker commands, make sure you are in the root directory of the project, where the docker-compose.yml file is located. This ensures that Docker Compose can correctly find the configuration and build the services.

Building and Running the Containers

You have two options for setting up the containers: pulling pre-built images from Docker Hub or building the images locally.

Option 1: Using Pre-built Images

To use the pre-built images from Docker Hub, run:

docker compose up

This will pull the images mohamdlog/droneworld-backend:v1.0.0 and mohamdlog/droneworld-frontend:v1.0.0 and run them.

Option 2: Building the Images Locally

If you have made changes to the code or want to build the images from scratch, use:

docker compose up --build

This will build the backend and frontend images from the local backend and frontend directories, respectively, and then run them.

Access the User Interface:

  • Open a web browser and navigate to http://localhost:3000 (or the URL displayed in your terminal).
  • This interface allows you to interact with the simulation, view data, and control the backend.

Step 3: Managing Containers

  • Stop all services:
docker compose down
  • Check status:
docker compose ps

Step 4: Updating Containers

After making changes to the code, rebuild and restart containers:

docker compose up --build