Sign inSign up

aircloud05/aircloud-chat

By aircloud05

•Updated about 1 year ago

This repository contains the backend server for a real-time chat application.

Image
0

149

aircloud05/aircloud-chat repository overview

⁠Description

AirCloud Chat is a containerized chat application that provides real-time messaging capabilities with MongoDB integration. This Docker image offers a scalable and easy-to-deploy chat solution.

⁠Quick Start

⁠Prerequisites
  • Docker and Docker Compose installed
  • MongoDB database (local or cloud instance)
  • Environment variables configured
⁠Environment Variables
  • MONGODB_URL: Connection string for your MongoDB database
  • API_TOKEN: Authentication token for API access
⁠Docker Compose Configuration
version: "3.8"
networks:
  aircloud-network:
    driver: bridge
services:
  aircloud_chat:
    image: aircloud05/aircloud-chat:1.0.0
    container_name: aircloud_chat
    build: .
    ports:
      - "5000:5000"
    environment:
      - MONGODB_URL=${MONGODB_URL}
      - API_TOKEN=${API_TOKEN}
    restart: always
    networks:
      - aircloud-network
⁠Environment Setup

Create a .env file in your project directory:

MONGODB_URL=mongodb://localhost:27017/aircloud-chat
API_TOKEN=your-secure-api-token
⁠Deployment Commands
  1. Start the application:

    docker-compose up -d
    
  2. View logs:

    docker logs aircloud_chat
    
  3. Follow logs in real-time:

    docker logs -f aircloud_chat
    
  4. Stop the application:

    docker-compose down
    

⁠Features

  • Real-time chat messaging
  • MongoDB integration for data persistence
  • RESTful API endpoints
  • Containerized deployment
  • Network isolation with custom bridge network
  • Automatic restart policy
  • Environment-based configuration

⁠Network Configuration

The application uses a custom Docker network (aircloud-network) with bridge driver for:

  • Service isolation
  • Internal communication between containers
  • Enhanced security

⁠Port Mapping

  • Host Port: 5000
  • Container Port: 5000
  • Access: Application will be available at http://localhost:5000

⁠MongoDB Integration

Users can connect to various MongoDB instances:

  • Local MongoDB server
  • MongoDB Atlas (cloud)
  • Self-hosted MongoDB
  • Docker-containerized MongoDB

Example MongoDB connection strings:

# Local MongoDB
MONGODB_URL=mongodb://localhost:27017/aircloud-chat

# MongoDB with authentication
MONGODB_URL=mongodb://username:password@localhost:27017/aircloud-chat

# MongoDB Atlas
MONGODB_URL=mongodb+srv://username:[email protected]/aircloud-chat

# Docker MongoDB service
MONGODB_URL=mongodb://mongo:27017/aircloud-chat

⁠Monitoring and Troubleshooting

⁠Health Checks

Monitor application status:

docker ps | grep aircloud_chat
⁠Log Analysis
# View recent logs
docker logs --tail 50 aircloud_chat

# Search logs for errors
docker logs aircloud_chat 2>&1 | grep -i error

# Monitor logs continuously
docker logs -f aircloud_chat
⁠Container Management
# Restart container
docker restart aircloud_chat

# Execute commands in container
docker exec -it aircloud_chat /bin/bash

# Inspect container details
docker inspect aircloud_chat

⁠Production Considerations

  • Use strong, unique API tokens
  • Implement proper MongoDB security (authentication, SSL)
  • Configure firewall rules for port 5000
  • Set up log rotation
  • Monitor resource usage
  • Regular security updates
  • Backup MongoDB data regularly

⁠Support

  • Container Logs: docker logs aircloud_chat
  • Network Issues: Check firewall and port accessibility
  • Database Connection: Verify MongoDB URL and credentials
  • Performance: Monitor container resource usage with docker stats

Tag summary

Content type

Image

Digest

sha256:48c482cec…

Size

1.2 GB

Last updated

about 1 year ago

docker pull aircloud05/aircloud-chat:1.0.0