Ready made MySQL database optimized for web application.
654
Ready made MySQL database optimized for web application. It is ready to use. Just add root password, app_username and app_password. That's all. Your database is ready to use.
There is how is your database created:
CREATE DATABASE IF NOT EXISTS `${DATABASE}` DEFAULT CHARACTER SET = 'utf8' DEFAULT COLLATE = 'utf8_general_ci';
CREATE USER IF NOT EXISTS '${USER}'@'%' IDENTIFIED BY '${PASSWORD}';
UPDATE mysql.user SET max_questions = 0, max_updates = 0, max_connections = 0 WHERE User = '{$USER}' AND Host = '%';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM '${USER}'@'%';
GRANT ALTER, CREATE, INSERT, SELECT, DELETE, REFERENCES, UPDATE, DROP, INDEX ON `${DATABASE}`.* TO '${USER}'@'%';
FLUSH PRIVILEGES;
The best solution is use docker-compose file for creating your application. Your application is connected outside (for example from nginx-proxy), but other services (like database) is only in internal network. It is not possible connect them from outside network.
There is an example docker-compose.yml
version: '3'
services:
app:
privileged: true
image: jndev/php7-apache2-symfony:alpine3.7
environment:
- VIRTUAL_HOST=app.dev
- DATABASE_URL=mysql://app_user:app_password@database:3306/app_database
networks:
- external
- internal
database:
image: jndev/maria-da:alpine3.7
environment:
- DB_ROOT_PASSWORD=root
- DATABASE=app_database
- USER=app_user
- PASSWORD=app_password
networks:
- internal
networks:
internal:
external:
external: true
Content type
Image
Digest
Size
58.1 MB
Last updated
over 8 years ago
docker pull jndev/maria-db:alpine3.7