garu1112

Docker Swarm Stacks: Streamlined Service Deployment

Docker Terraform AWS CLI Releases

Table of Contents

Overview

This project helps developers quickly deploy backing services that are commonly used during the development cycle. It contains Terraform modules for deploying Docker stacks into a Swarm cluster. For automated deployment, refer to the Automated Setup section. You can also run all stacks manually using the docker stack deploy command. For manual instructions, see the Manual Setup.

To access the latest releases, visit Releases.

Prerequisites

Before you begin, ensure you have the following tools installed:

AWS Configuration

Make sure to configure your AWS CLI. Create or edit the ~/.aws/config file:

[profile localstack]
region=us-east-1
output=json
endpoint_url = http://localhost:4566

Also, set up your credentials in ~/.aws/credentials:

[localstack]
aws_access_key_id=test
aws_secret_access_key=test

Getting Started

To initialize your Docker Swarm, run the following command:

docker swarm init --task-history-limit=0

This command sets up your Swarm cluster, allowing you to deploy services.

Automated Setup

Use Terraform to provision your Docker Swarm cluster, deploy stacks, and manage resources efficiently. The Terraform scripts in this repository simplify the deployment process.

Steps for Automated Setup

  1. Clone the repository:

     git clone https://github.com/garu1112/docker-swarm-stacks.git
     cd docker-swarm-stacks
    
  2. Initialize Terraform:

     terraform init
    
  3. Plan your deployment:

     terraform plan
    
  4. Apply your configuration:

     terraform apply
    

This process will provision the necessary resources and deploy the defined stacks.

Manual Setup

If you prefer to deploy stacks manually, you can use the docker stack deploy command. Here’s how:

  1. Navigate to the directory of the stack you want to deploy.
  2. Run the following command:

     docker stack deploy -c <your-stack-file>.yml <stack-name>
    

Replace <your-stack-file>.yml with the name of your stack file and <stack-name> with your desired stack name.

Services Included

This repository supports various services, each useful for different aspects of development. Here’s a list of the services included:

Contributing

We welcome contributions to improve this project. If you want to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes and commit them (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a pull request.

Please ensure your code adheres to the project’s coding standards and includes appropriate tests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

For more information, check the Releases section.