This project uses Docker Compose to manage multiple services for a Django application. It includes the following services:
- Service Name:
web - Description: Django web service with Gunicorn as the WSGI server.
- Usage: Exposes Django application on port 8000.
- Service Name:
db - Description: PostgreSQL database service.
- Usage: Exposes PostgreSQL on port 5432.
- Service Name:
pgadmin - Description: pgAdmin service for managing PostgreSQL databases.
- Usage: Exposes pgAdmin on port 5050.
- Service Name:
dozzle - Description: Container logs viewer for monitoring Docker containers.
- Usage: Exposes Dozzle on port 9999.
- Service Name:
vector - Description: Vector service for shipping logs to BetterStack platform.
- Usage: Configured to ship logs from Docker containers and Docker daemon.
- Service Name:
prometheus - Description: Prometheus service for monitoring.
- Usage: Exposes Prometheus on port 9090.
- Service Name:
node-exporter - Description: Prometheus exporter for collecting hardware and OS metrics.
- Usage: Exposes Node Exporter on port 9100.
- Service Name:
nginx-exporter - Description: Prometheus exporter for Nginx metrics.
- Usage: Exposes Nginx Exporter on port 9913.
- Service Name:
grafana - Description: Grafana service for visualization and monitoring.
- Usage: Exposes Grafana on port 3000.
-
Copy the Environment File:
- Copy
.env.exampleto.envand adjust the configurations as needed.
- Copy
-
Run Services:
- Start the services using Docker Compose:
docker-compose up -d
- Start the services using Docker Compose:
-
Access Services:
- Django Application: http://localhost:8000
- pgAdmin: http://localhost:5050
- Dozzle: http://localhost:9999
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000
-
Postgres DB Logging Issue:
- The PostgreSQL database logs an error: "role 'root' does not exist". The database works regardless, but this issue needs to be resolved.
-
Vector Log Shipping:
- Shipping logs using Vector still needs a bit of work to ensure all logs are correctly shipped to BetterStack.
-
Postgres Startup Packet Error:
- PostgreSQL logs an error: "invalid length of startup packet". This is related to connections to the database, but only the Django service is currently connected.
-
MongoDB Express Connection Issue:
- MongoDB Express tries to connect to MongoDB before MongoDB is fully operational, even with the
depends_onattribute.
- MongoDB Express tries to connect to MongoDB before MongoDB is fully operational, even with the
-
Grafana Configuration:
- Grafana setup and configuration need further attention to ensure it works correctly with the provided datasources.
- Ensure that Docker and Docker Compose are installed on your system.
- Adjust the environment variables in the
.envfile to match your setup. - The
docker-compose.prod.ymlfile is configured for production use. For development, use thedocker-compose.ymlfile. - Feel free to explore each service in detail. Happy coding!