https://github.com/asapdotid/dcc-mysqldb
Docker Compose MysqlDB
https://github.com/asapdotid/dcc-mysqldb
bitnami-image database docker-compose mysql mysql-database
Last synced: 2 months ago
JSON representation
Docker Compose MysqlDB
- Host: GitHub
- URL: https://github.com/asapdotid/dcc-mysqldb
- Owner: asapdotid
- Created: 2023-06-25T06:18:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-13T05:31:41.000Z (over 1 year ago)
- Last Synced: 2024-12-27T16:43:02.583Z (over 1 year ago)
- Topics: bitnami-image, database, docker-compose, mysql, mysql-database
- Language: Makefile
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Compose MySQL DB (LTS)
Docker image base `mysql` [link](https://hub.docker.com/_/mysql/)
## Make sure docker network exist:
```bash
docker network create secure
```
## Makefile commands for run the code
```bash
make help
```
First of all:
- Init setup env: `make init`
- Init docker compose env: `make set-env`
-
## Custom environment file
> After first command `make ini` do not change env file on `.make/.env`
> After command `make set-env` can change value of env file on `src/.env`
Running command `make`:
```bash
# Start docker compose
make up
```
```bash
# Stop docker compose
make down
```
```bash
# Check logs docker compose
make logs
```
## MySQL environment variables
You could custom environment of setup database to development or production on `.make/.env`:
```bash
# Development
DOCKER_PROJECT_DEV=true
```
Or
```bash
# Production
DOCKER_PROJECT_DEV=false
```
## Troubleshoot Persisting your data
Now chown this directory to `1001:1001` since the image is using UID `1001` as the user running the command:
```bash
sudo chown -R 1001:1001 .data
```
## Database Management
Optional for database management using Adminer [asapdotid/dcc-adminer](https://github.com/asapdotid/dcc-adminer)
```yaml
---
networks:
proxy:
driver: bridge
external: true
secure:
driver: bridge
external: true
services:
adminer:
image: adminer:latest
restart: unless-stopped
ports:
- "8080:8080"
networks:
- proxy
- secure
```
Note:
Connection to database:
- Host: `mysqldb_master` # MySQL service name
- Username: `root` # MySQL root user
- Password: `my_S3cret` # value of `MYSQL_ROOT_PASSWORD`
## Running utility script
```bash
docker exec -i database-mysqldb_master-1 sh -c './tmp/utility-db.sh'
```
## License
MIT / BSD
## Author Information
This Code was created in 2023 by [Asapdotid](https://github.com/asapdotid).