This repository contains the Docker Compose configuration for orchestrating the ROUTE application's backend and frontend services.
This DevOps setup provides a containerized development and deployment environment for the ROUTE project, managing both backend and frontend services through Docker Compose.
The project consists of two main services:
- Backend: API service running on port
8000 - Frontend: Web application running on port
3000
The frontend service depends on the backend service and will wait for it to be ready before starting.
Before you begin, ensure you have the following installed:
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
devops/
βββ docker-compose.yaml # Docker Compose configuration
βββ README.md # This file
../backend/ # Backend service source code
../frontend/ # Frontend service source code
Make sure you have the complete project structure with both backend and frontend directories at the same level as the devops directory.
From the devops directory, run:
docker-compose upTo run in detached mode (background):
docker-compose up -dIf you need to rebuild the images:
docker-compose up --buildTo stop all running services:
docker-compose downTo stop and remove volumes:
docker-compose down -vOnce the services are running:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
| Command | Description |
|---|---|
docker-compose up |
Start all services |
docker-compose up -d |
Start all services in detached mode |
docker-compose up --build |
Rebuild images and start services |
docker-compose down |
Stop and remove containers |
docker-compose ps |
List running containers |
docker-compose logs |
View logs from all services |
docker-compose logs [service] |
View logs from a specific service |
docker-compose restart |
Restart all services |
- Container Name:
backend-container - Port:
8000:8000 - Build Context:
../backend - Dockerfile:
Dockerfile
- Container Name:
frontend-container - Port:
3000:3000 - Build Context:
../frontend - Dockerfile:
Dockerfile - Dependencies: Backend service
If you encounter port conflicts:
-
Check if ports 3000 or 8000 are already in use:
lsof -i :3000 lsof -i :8000
-
Modify the port mappings in
docker-compose.yamlif needed
-
Check Docker and Docker Compose versions:
docker --version docker-compose --version
-
View service logs:
docker-compose logs backend docker-compose logs frontend
-
Ensure the backend and frontend directories exist and contain valid Dockerfiles
If you've made changes to the backend or frontend code:
docker-compose up --build[Add your license information here]
[Add contributor information here]