A Docker-based three-tier application for managing events, similar to Eventbrite. The application features an Angular front-end, a Golang backend, and a MongoDB-based microservice for location indexing and queries. Integrated monitoring is provided by Linkerd and Prometheus.
- Event Management Application
This project is a Docker-based three-tier application for managing events. It uses Docker Compose for orchestration and integrates various tools for monitoring.
- Angular front-end for displaying event data.
- Golang backend for CRUD operations on events and users.
- MongoDB microservice for location indexing and queries.
The application is divided into three main components:
- Front-end: An Angular application that displays event data to the users.
- Backend API: A Golang application that handles postgres CRUD operations on events and users.
- GeoSpacial API: A service for communicating with the backend API via gRPC, using MongoDB for location indexing and queries.
Ensure you have the following installed:
Clone the repository:
git clone https://github.com/Johnyoat/ezy-event-deployment.git
cd ezy-event-deployment
Start the services using Docker Compose:
docker-compose up -d
This command will build the Docker images (if not already built) and start the services in the background.
To stop the services:
docker-compose down
There's no password for mongodb but there's a password for postgres which is qigfot-4Sobja-wixjut
and username postgres
. Both databases can be connected with their respective clients from the deployed host.
-
Initial Databse
ezyevents
is created from the deployment and import the sample dataevent-location-data
intoezyevents-location
collection. -
A 2DSphere index is created for the collection. You can read more here
The deployment creates a database called ezyevent
and load sample data ezyevent.sql
into it.
It's still a work in progress but you can clone it from here
git clone https://github.com/Johnyoat/ezy-event-deployment
Vist the repo for more instructions
version: '3.8'
services:
postgres-database:
image: postgres:alpine
ports:
- "5432:5432"
environment:
POSTGRES_DB: ezyevents
POSTGRES_PASSWORD: qigfot-4Sobja-wixjut
PGDATA: /var/lib/postgressql/data
volumes:
- ./postgres:/var/lib/postgressql/data
- ./ezyevent.sql:/docker-entrypoint-initdb.d/ezyevent.sql
restart: always
networks:
- ezy-network
mongodb:
image: mongo
environment:
MONGO_INITDB_DATABASE: ezyevents
ports:
- "27017:27017"
volumes:
- ./mongo:/data/db
- ./event-location-data.js:/docker-entrypoint-initdb.d/event-location-data.js:ro
restart: always
networks:
- ezy-network
ezy-event-api:
image: johnyoat/ezyevent-api:1.1
ports:
- "8080:8080"
links:
- postgres-database
networks:
- ezy-network
depends_on:
- postgres-database
restart: on-failure:20
ezy-event-location-api:
image: johnyoat/ezyevent-location-api:1.1
ports:
- "8081:8081"
links:
- "ezy-event-api"
networks:
- ezy-network
depends_on:
- ezy-event-api
restart: always
ezy-event-web-app:
image: johnyoat/ezyevent-web:1.2
ports:
- "80:80"
networks:
- ezy-network
depends_on:
- ezy-event-api
networks:
ezy-network:
driver: bridge
- Image:
postgres:alpine
- Uses the lightweight Alpine-based PostgreSQL image.
- Ports:
5432:5432
- Maps port 5432 on the host to port 5432 in the container.
- Environment Variables:
POSTGRES_DB
:ezyevents
POSTGRES_PASSWORD
:qigfot-4Sobja-wixjut
PGDATA
:/var/lib/postgressql/data
- Volumes:
./postgres:/var/lib/postgressql/data
./ezyevent.sql:/docker-entrypoint-initdb.d/ezyevent.sql
- Restart Policy:
always
- Always restarts the container if it stops.
- Network:
ezy-network
- Image:
mongo
- Uses the official MongoDB image.
- Environment Variable:
MONGO_INITDB_DATABASE
:ezyevents
- Ports:
27017:27017
- Maps port 27017 on the host to port 27017 in the container.
- Volumes:
./mongo:/data/db
./event-location-data.js:/docker-entrypoint-initdb.d/event-location-data.js:ro
- Restart Policy:
always
- Always restarts the container if it stops.
- Network:
ezy-network
- Image:
johnyoat/ezyevent-api:1.1
- Custom image for the EzyEvent API.
- Ports:
8080:8080
- Maps port 8080 on the host to port 8080 in the container.
- Links:
postgres-database
- Links to the PostgreSQL database service.
- Network:
ezy-network
- Depends On:
postgres-database
- Ensures the database starts before this service.
- Restart Policy:
on-failure:20
- Restarts up to 20 times on failure.
- Image:
johnyoat/ezyevent-location-api:1.1
- Custom image for the EzyEvent Location API.
- Ports:
8081:8081
- Maps port 8081 on the host to port 8081 in the container.
- Links:
ezy-event-api
- Links to the EzyEvent API service.
- Network:
ezy-network
- Depends On:
ezy-event-api
- Ensures the EzyEvent API starts before this service.
- Restart Policy:
always
- Always restarts the container if it stops.
- Image:
johnyoat/ezyevent-web:1.2
- Custom image for the EzyEvent web application.
- Ports:
80:80
- Maps port 80 on the host to port 80 in the container.
- Network:
ezy-network
- Depends On:
ezy-event-api
- Ensures the EzyEvent API starts before this service.
- Driver:
bridge
- Creates an isolated network for the services.
Simply use Docker Compose to manage the deployment locally or in a Docker Swarm.
docker-compose up -d
Contributions are welcome! Please read the contributing guidelines for more information.
This project is licensed under the MIT License. See the LICENSE file for details.
For any inquiries or feedback, please contact:
- Osei Yeboah Johnson - [email protected]
- Project Link: https://github.com/Johnyoat/ezy-event-deployment