This repository contains configuration files for running multiple database services using Docker Compose. The services included are PostgreSQL, Redis, MongoDB, MySQL, Adminer, PgAdmin, and RedisInsight. These services are intended to be used as shared databases for various projects, allowing for easy management and consistency.
- Image:
postgres
- Ports:
5432:5432
- Volumes:
./data/postgres:/var/lib/postgresql/data
- Environment Variables:
POSTGRES_USER
: rootPOSTGRES_PASSWORD
: pass
- Image:
redis
- Ports:
6379:6379
- Volumes:
./data/redis:/data
- Image:
mongo
- Ports:
27017:27017
- Volumes:
./data/mongo:/data/db
- Environment Variables:
MONGO_INITDB_ROOT_USERNAME
: rootMONGO_INITDB_ROOT_PASSWORD
: pass
- Image:
mysql
- Ports:
3306:3306
- Volumes:
./data/mysql:/var/lib/mysql
- Environment Variables:
MYSQL_ROOT_PASSWORD
: pass
- Image:
adminer
- Ports:
8080:8080
- Environment Variables:
ADMINER_DEFAULT_SERVER
: mysqlADMINER_DESIGN
: pma-darkADMINER_USER
: adminADMINER_PASSWORD
: root
- Image:
dpage/pgadmin4
- Ports:
5050:80
- Environment Variables:
PGADMIN_DEFAULT_EMAIL
: admin@example.comPGADMIN_DEFAULT_PASSWORD
: admin
- Volumes:
./data/pgadmin:/var/lib/pgadmin
- Image:
redislabs/redisinsight
- Ports:
5540:5540
- Environment Variables:
REDISINSIGHT_ALLOW_DEFAULT_PASSWORD
: "yes"
To start a specific service, use the following command:
docker compose up <service-name>
Replace <service-name>
with the name of the service you want to start (e.g., postgres
, redis
, mongo
, mysql
, adminer
, pgadmin
, redis_insight
).
To run only the PostgreSQL service:
docker compose up postgres
To run multiple services, list them separated by a space:
docker compose up postgres mongo
To stop a specific service, use the following command:
docker compose stop <service-name>
To stop the PostgreSQL service:
docker compose stop postgres
To start a service in detached mode (running in the background), use the -d
flag:
docker compose up -d <service-name>
To start PostgreSQL in detached mode:
docker compose up -d postgres
Each service has a designated volume for data persistence. These volumes are mounted from the host system to ensure that data is retained even if the container is restarted or removed.
- PostgreSQL data is stored in
./data/postgres
. - Redis data is stored in
./data/redis
. - MongoDB data is stored in
./data/mongo
. - MySQL data is stored in
./data/mysql
. - PgAdmin data is stored in
./data/pgadmin
.
For security purposes, sensitive information like passwords is managed through environment variables. You can modify these values in the docker-compose.yml
file as needed.
- Added Adminer, PgAdmin, and RedisInsight sections.
- Updated the data persistence paths to match your Docker Compose file.
- Included environment variables for all services.
Feel free to modify any part of the README further if needed!