My Docker Compose Collection
Basic command
|
|
Kafka CLI
Download docker compose configuration using curl
|
|
This yaml kafka-cli.yaml
will create a new container zookeeper
and exposed port 2181
on host port. Also create a new container kafka
and exposed port 29092
, 9092
and 9101
on host port.
Redis
By default there are 16 databases (indexed from 0 to 15) and you can navigate between them using select
command. Number of databases can be changed in redis config file with databases
setting.
Download docker compose configuration using curl
|
|
This yaml redis.yaml
will create a new container redis
and exposed port 6379
on host port.
Redis CLI
Run redis-cli
|
|
Select the Redis logical database having the specified zero-based numeric index. New connections always use the database 0.
Change database.
|
|
Set and get key
|
|
Another Redis Desktop Manager
Install Another Redis Desktop Manager with homebrew. You can run with following command on your terminal.
|
|
Open the application, and should looks like below.
Another Redis Desktop Manager dashboard
Another Redis Desktop Manager add new key.
MySQL
Download docker compose configuration using curl
|
|
This yaml mysql.yaml
will create a new container mysql
and exposed port 3306
on host port.
Create network my-network
if does not exists
|
|
Create volume mysql-data
to persist data then run docker-compose
|
|
MySQL CLI
Run this command to run MySQL command on container. Default user is root
and password SevenEightTwo782
you can change the password in yaml
file.
|
|
Basic command:
- Login into database, then type your password
1
mysql -u root -p
- Get list of databases
1
show databases;
- Create database and use database
1 2
create database $DB_NAME; use $DB_NAME;
PostgreSQL
Download docker compose configuration using curl
|
|
This yaml postgresql.yaml
will create a new container postgresql
and exposed port 5432
on host port.
Create network my-network
if does not exists
|
|
Create volume postgre-data
to persist data then run docker-compose
|
|
Postgre SQL CLI
Run this command to run PostgreSQL command on container. Default user is postgres
and password SevenEightTwo782
you can change the password in yaml
file.
|
|
Basic command:
- Login into database
1
psql -Upostgres -w
- Get list of databases
1
\l
- Create database and use database
1 2
create database $DB_NAME; \c $DB_NAME
SQL Server
Download docker compose configuration using curl
|
|
This yaml sqlserver.yaml
will create a new container sqlserver
and exposed port 1433
on host port.
Create network my-network
if does not exists
|
|
Create volume sqlserver-data
and sqlserver-user
to persist data then run docker-compose
|
|
SQL Server CLI
Run this command to run SQL Server command on container. Default user is sa
and password SevenEightTwo782
you can change the password in yaml
file.
|
|
Basic command:
- Get list of databases
1 2
select name from sys.databases go
- Create database and use database
1 2
create database $DB_NAME go
RabbitMQ
Download docker compose configuration using curl
|
|
This yaml rabbitmq.yaml
will create a new container rabbitmq
and exposed port 5672
and 15672
on host port.
Create network my-network
if does not exists
|
|
Create volume rabbitmq-data
and rabbitmq-log
to persist data then run docker-compose
|
|
RabbitMq Management
Default RabbitMQ management user is guest
and password is guest
. Go to localhost:15672
to acess RabbitMQ management.
Sonarqube
Download docker compose configuration using curl
|
|
This yaml sonarqube.yaml
will create a new container sonarqube
and exposed port 9000
and 9002
on host port.
Create network my-network
if does not exists
|
|
Create volume to persist data then run docker-compose
|
|
Sonarqube Management
Default Sonarqube management user is admin
and password is admin
. Go to localhost:9000
to acess Sonarqube management and then change the default password first.
MongoDB
Download docker compose configuration using curl
|
|
This yaml mongodb.yaml
will create a new container mongodb
and exposed port 27017
on host port.
Create network my-network
if does not exists
|
|
Create volume to persist data then run docker-compose
|
|
MongoDB CLI
Run this command to run MongoDB command on container. Default user is root
and password SevenEightTwo782
you can change the password in yaml
file.
|
|
Basic command:
- Get list of databases
1
show dbs
- Create database and use database
1 2
use some_db db
- Create collection
1
db.createCollection('some_collection');
- Insert row
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
db.some_db.insertMany([ { _id: 1, first_name: "Maverick", last_name: "Johnson", gender: 1 }, { _id: 2, first_name: "Calvin", last_name: "Joe", gender: 1 }, { _id: 3, first_name: "Kagura", last_name: "Otsusuki", gender: 0 } ]);
- Find row
1
db.some_db.find();
- Update row
1 2 3 4 5
db.test.updateOne({_id: 1}, {$set: { first_name: "Maverick", last_name: "Johnson Updated", gender: 1 }});