Skip to content

Latest commit

 

History

History
115 lines (78 loc) · 2.41 KB

README.md

File metadata and controls

115 lines (78 loc) · 2.41 KB

ccn-coverage-docker

Overview

This repository contains the Docker setup for deploying the coverage API and visualization services locally for coverage.seattlecommunitynetwork.org . It includes the following components:

  • ccn-coverage-api: The backend API service.
  • ccn-coverage-vis: The frontend visualization service.
  • MongoDB: The database service.

Prerequisites

Ensure you have the following installed on your system:

Deployment

Follow these steps to deploy the services using Docker Compose.

Clone the Repository

git clone https://github.com/Local-Connectivity-Lab/ccn-coverage-docker.git
cd ccn-coverage-docker

Update Environment Variables

Ensure the MONGODB_URI and API_URL environment variables are correctly set in the docker-compose.yml file.

services:
  ccn-coverage-api:
    ...
    environment:
      - MONGODB_URI=mongodb://mongodb:27017/api-data

  ccn-coverage-vis:
    ...
    environment:
      - API_URL=http://ccn-coverage-api:3000

Build and Start the Services

To build and start the services, run the following command:

docker compose up -d

Verify the Deployment

  1. Check the running containers:

    docker ps

    You should see the containers for ccn-coverage-api, ccn-coverage-vis, and mongodb running.

  2. Access the services in your browser:

    • API service: http://localhost:3000
    • Visualization service: http://localhost:3002
  3. Check the logs for any errors:

    docker compose logs -f

Maintenance

Stopping the Services

To stop the running services, use:

docker compose down

Rebuilding the Services

If you make changes to the Dockerfiles or the source code, rebuild the services:

docker compose up --build -d

Removing Unused Docker Images

To clean up unused Docker images and free up space, run:

docker system prune -a

Troubleshooting

  • Check container logs for errors:

    docker logs <container_name>
  • Verify MongoDB connection:

    docker exec -it ccn-coverage-docker-mongodb-1 mongo
    use api-data
    show collections

Contributing

Feel free to open issues or submit pull requests for any improvements or bug fixes.