This repository contains the Docker Compose files and Dockerfiles needed to create a multi-container Docker application that includes a Jenkins server, a CentOS container with the AWS CLI installed, a MySQL database server, and an Ansible web server.
- Clone the repository:
git clone https://github.com/SofiaNeogalaxy/docker-compose-multi-container-app.git
- Navigate to the cloned directory:
cd <your-repository>
- Set up your environment variables:
export DB_HOST=<your-database-host>; export DB_PASSWORD=<your-database-password>; export DB_NAME=<your-database-name>; export AWS_SECRET=<your-aws-secret-key>; export BUCKET_NAME=<your-aws-s3-bucket-name>
- Run the script to create a backup of your database and upload it to S3:
./script.sh $DB_HOST $DB_PASSWORD $DB_NAME $AWS_SECRET $BUCKET_NAME
- Build the Docker images:
docker-compose build
- Start the Docker containers:
docker-compose up -d
- Access the Jenkins dashboard at http://localhost:8080.
- Use Ansible to configure your remote host:
ansible-playbook -i hosts play.yml
- Use the put.sh script to generate random data and add it to a file:
./put.sh