Skip to content

Docker Guide

Mohammad edited this page Oct 18, 2024 · 8 revisions

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

Prerequisites

Before using Docker, ensure you have the following installed:

  • Docker: Install Docker on your system.
  • Docker Compose: Installed with Docker Desktop.

Project Structure

Ensure your project structure looks like this (simplified):

backend/                # Python-based backend service
frontend/               # Node.js-based frontend service
config/
    settings.json       # Configuration file for backend
docker-compose.yml      # Docker Compose file to orchestrate the services

1. Building and Running the Containers

To build and run both services (backend and frontend):

docker compose up --build

2. Managing Containers

  • Stop all services:
docker compose down
  • Check status:
docker compose ps
  • View logs:
docker compose logs -f

3. Cleaning Up

Remove unused containers, images, or volumes:

  • Stopped containers:
docker container prune
  • Unused images:
docker image prune -a
  • Unused volumes:
docker volume prune

4. Updating Containers

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

docker compose up --build
Clone this wiki locally