This is for managing mysql
and phpMyAdmin
.
Create an environment file for docker
and docker compose
and check the configuration.
cp default.env .env
Note: This file will not be under version control but listed in .gitignore.
Check for the existence of environment.prod.ts
as described in Mittagstisch - frontend.
Check for the existence of application-prod.yml
as described in Mittagstisch - backend.
- COMPOSE_PROJECT_NAME
- MYSQL_PASSWORD
- MYSQL_PORT
- MYSQL_USER
- MYSQL_VERSION
- PHPMYADMIN_PORT
- PHPMYADMIN_VERSION
Defines a global name for the compose project used for the container and the database
- default:
mittagstisch
- type:
string
Defines the password for mySQL
- default:
mysql
- type:
string
Defines the port for mySQL
- default:
3306
- type:
string
Defines the user for mySQL
- default:
mysql
- type:
string
Defines the version for mySQL
- default:
8.0.30
- type:
string
Defines the port for phpMyAdmin
- default:
80
- type:
string
Defines the version for phpMyAdmin
- default:
5.2.0
- type:
string
To work with the compose file use following commands.
Use as project-name
the same name from the configuration COMPOSE_PROJECT_NAME
.
If you manage your data in this project, run following commands.
Note: On the first run you need to look into the logs of mysql to get the root password. The password will not shown again.
# run compose file
docker compose --project-name mittagstisch -f compose.yml -f compose-mysql.yml up -d
# check the log file of the mysql service and search for "GENERATED ROOT PASSWORD" and note this
docker logs mittagstisch_mysql
# stop compose file
docker compose --project-name mittagstisch down
If you manage your data out of this project, you can use the dump file (dump.sql
) and connect to your database.
Then run following commands:
# run compose file
docker compose --project-name mittagstisch up -d
# stop compose file
docker compose --project-name mittagstisch down