At the core of successful web projects lies a database, be it SQL or NoSQL, relational or object-relational. There, your articles, products, posts, and user-data are being stored and held ready for request.
sloppy.io offers a wide variety of database solutions, based on the whole catalogue of images on Docker Hub. In this article, I will give you an overview of the most popular db solutions and how to set them up.
Guidelines and step-by-step instructions
Here's what you basically need:
- the Docker image of your preferred database-management system
- a web-based administration tool to go with it
Keep in mind that due to security reasons, we're not exposing any TCP ports, so you'll need a web-based solution for administration purposes.
That said, here are some beginner-friendly tutorials for the most popular database systems out there. If you're in need of advice for a different one, just contact us.
List of database systems and administration tools
If you already know how to set your database up, here's a list of Docker images and Environment Variables for different database-management systems. This list is ongoing, so keep coming back for updates. As mentioned above, please contact us for suggestions.
MySQL and MariaDB
- MySQL: https://hub.docker.com/_/mysql/
- MariaDB: https://hub.docker.com/_/mariadb/
- MySQL and MariaDB Environment Variables:
MYSQL_ROOT_PASSWORD
- phpMyAdmin: https://hub.docker.com/r/phpmyadmin/phpmyadmin/
- phpMyAdmin Environment Variables:
MYSQL_ROOT_PASSWORD
,PMA_HOST
MongoDB
- MongoDB: https://hub.docker.com/_/mongo/
- MongoDB Environment Variables:
MONGO_INITDB_ROOT_USERNAME
[opt.],MONGO_INITDB_ROOT_PASSWORD
[opt.] - Mongo-Express: https://hub.docker.com/_/mongo-express/
- Mongo-Express Environment Variables:
ME_CONFIG_MONGODB_SERVER
,ME_CONFIG_MONGODB_ADMINUSERNAME
[opt.],ME_CONFIG_MONGODB_ADMINPASSWORD
[opt.],ME_CONFIG_BASICAUTH_USERNAME
[opt.],ME_CONFIG_BASICAUTH_PASSWORD
[opt.] - If you're using MongoDB 3.6 or newer and you're setting the command (cmd) property to pass command-line flags, you also have to set the
bind_ip
parameter to allow connections from other hosts. For example, when you're using a command to set--smallfiles
:
mongod --smallfiles --bind_ip=0.0.0.0
PostgreSQL
- PostgreSQL: https://hub.docker.com/_/postgres/
- PostgreSQL Environment Variables:
POSTGRES_USER
,POSTGRES_PASSWORD
- Adminer: https://hub.docker.com/_/adminer/
- Adminer Environment Variables: none, connection to database via Adminer UI