Skip to content

Latest commit

 

History

History
72 lines (48 loc) · 1.86 KB

deployment.md

File metadata and controls

72 lines (48 loc) · 1.86 KB

Deployment

This guide will walk you through the steps to deploy the Golang microservice application using Docker Compose.

Prerequisites

Setup

  1. Clone the repository and navigate to the root directory of the project:
git clone https://github.com/infranyx/go-microservice-template
cd go-microservice-template
  1. Create a .env file in the envs directory of the project and copy the local.env environment variables.

  2. Run the following command to build and start the containers:

docker-compose up -d --build

This will build and start the following containers:

  • postgres: PostgreSQL database
  • kafka: Kafka message broker
  • zookeeper: In the context of Kafka, Zookeeper is used to store metadata about the Kafka cluster and its topics. It helps the Kafka brokers maintain their cluster membership and elect leaders, and it also helps clients discover the location of the Kafka brokers.
  • redis: Redis cache
  • sentry: Sentry error tracking service
  • app: Golang microservice application

Verification

To verify that the containers are running, use the following command:

docker-compose ps

Maintenance

To stop the containers, use the following command:

docker-compose stop

To start the containers again, use the following command:

docker-compose start

To remove the containers, use the following command:

docker-compose down