Database layer for Vprofile Application Stack
120
This Docker image sets up a MySQL 8.0.33 database server pre-configured for the VProfile project. It includes an initial database and schema setup from a provided SQL backup file. This image is intended to streamline the deployment process of the VProfile project by providing a ready-to-use database server.
mysql:8.0.33MYSQL_ROOT_PASSWORD: Root password for MySQLMYSQL_DATABASE: Name of the initial databasedb_backup.sqlTo pull the Docker image from DockerHub:
docker pull your-dockerhub-username/vprofile-mysql
To run the Docker container:
docker run -d -p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=Root password for MySQL \
-e MYSQL_DATABASE=accounts \
ardhendushekhar/vprofiledb:latest
This command will start a MySQL database container with the specified root password and initial database, accessible at localhost:3306.
For integrating this MySQL database with other services, you can use Docker Compose. Below is an example docker-compose.yml:
version: '3'
services:
mysql:
image: mysql:8.0.33
environment:
MYSQL_ROOT_PASSWORD: Root password for MySQL
MYSQL_DATABASE: Name of the initial database
ports:
- "3306:3306"
Run with:
docker-compose up -d
You can customize the environment variables to match your requirements:
MYSQL_ROOT_PASSWORD: Set this to your desired root password.MYSQL_DATABASE: Set this to the name of the database you want to create.Example:
docker run -d -p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=mynewpassword \
-e MYSQL_DATABASE=mydatabase \
ardhendushekhar/vprofiledb:latest
When the container is started for the first time, the contents of the db_backup.sql file will be used to initialize the database. This file should contain the SQL commands to set up the database schema and populate it with initial data.
If you want to build the Docker image locally:
Create a db_backup.sql file with your database schema and initial data.
Create a Dockerfile:
FROM mysql:8.0.33
LABEL "Author"="Ardhendu Shekhar"
LABEL "Project"="Vprofile-Containerization"
ENV MYSQL_ROOT_PASSWORD=""
ENV MYSQL_DATABASE=""
ADD db_backup.sql /docker-entrypoint-initdb.d
EXPOSE 3306
Build the Docker image:
docker build -t your-dockerhub-username/vprofile-mysql .
Run the Docker container:
docker run -d -p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=""\
-e MYSQL_DATABASE=""\
your-dockerhub-username/vprofile-mysql
If you wish to contribute to this project, please follow these steps:
git checkout -b feature/YourFeature).git commit -am 'Add some feature').git push origin feature/YourFeature).This Docker image simplifies the setup and deployment of a MySQL database for the VProfile project, ensuring a consistent environment and reducing setup time. Enjoy developing and deploying your applications with ease!
Content type
Image
Digest
sha256:97e813a5a…
Size
158 MB
Last updated
almost 3 years ago
docker pull ardhendushekhar/vprofiledb