Skip to content

Commit 517f5fc

Browse files
committed
initialize dockerized-database
0 parents  commit 517f5fc

File tree

10 files changed

+110
-0
lines changed

10 files changed

+110
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Edward Fernandez
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Dockerized Database
2+
3+
This repository contains my setup for dockerized databases. As a work in progress, I am continuously improving and refining the setup to ensure optimal performance, reliability, and security.
4+
5+
## Databases
6+
7+
- MySQL
8+
- Redis
9+
- Postgres
10+
11+
## Usage
12+
13+
1. Clone this repository.
14+
2. Navigate to the database you want to use.
15+
3. Run `docker-compose up`.
16+
17+
## License
18+
19+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

mysql/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mysql-data

mysql/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# MySQL Docker Container
2+
3+
This is a containerized MySQL database
4+
5+
<!-- INSTALLATION -->
6+
7+
### Installation
8+
9+
1. Clone the repo
10+
11+
```sh
12+
git clone https://github.com/wardvisual/dockerized-db.git
13+
```
14+
15+
<!-- Setup -->
16+
17+
### Setup
18+
19+
1. To run the container, use the following command:
20+
21+
```sh
22+
docker compose up
23+
```
24+
25+
2. To open a bash shell in the container, use the following command:
26+
27+
```sh
28+
docker exec -it [container_name] bash
29+
```
30+
31+
3. To login as mysql root, use the following command:
32+
33+
```sh
34+
mysql -u root -p
35+
```
36+
37+
4. To update the server root password, use the following command:
38+
39+
```sh
40+
mysql> ALTER USER ‘root’@‘localhost’ IDENTIFIED BY [new_password]
41+
```
42+
43+
<hr />
44+
45+
I hope this helps! Let me know if you have any other questions.
46+
47+
### Contact
48+
49+
Edward Fernandez: [Wardvisual](https://wardvisual.me/)

mysql/d_mysql_db/conf.d/my-custom.cnf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[mysqld]
2+
max_connections=250

mysql/docker-compose.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: "3.8"
2+
services:
3+
d_mysql_db:
4+
image: mysql/mysql-server:latest
5+
container_name: d_mysql_db
6+
environment:
7+
MYSQL_ROOT_PASSWORD: __password__
8+
ports:
9+
- "3307:3306"
10+
volumes:
11+
- $HOME/core/docker/database/mysql/conf.d:/etc/mysql/conf.d
12+
- $HOME/core/docker/database/mysql/mysql-data:/var/lib/mysql

postgres/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
data
2+
postgres-data

postgres/docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

redis/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
data
2+
redis-data

redis/docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)