Skip to content

Commit

Permalink
adminer instead of phpmyadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
nik2208 committed Oct 12, 2023
1 parent 95c10d0 commit a5d4c88
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A customizable, ready-to-go, Docker Compose file featuring
- MySQL
- PHP-FPM
- NGINX
- PHPMYADMIN
- ADMINER
- SWAGGER (OPENAPI)

## INSTALLATION:
Expand Down Expand Up @@ -36,15 +36,16 @@ PHP_CRUD_API_DEBUG=true
```

Then run `docker compose up -d`. Enjoy!🎉🚀
Refer to [PHP-CRUD-API](https://github.com/mevdschee/php-crud-api) for further customizations.

## REQUIREMENTS:
- Any host runnign [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/).

In case your running your instance on localhost and your selected port is 8080
**Your `tests` table will be available at**
http://127.0.0.1:8080/records/tests (no need of explicit api.php)[^1]
**Your PHPMYADMIN instance will be available at**
https://127.0.0.1:8080/phpmyadmin/
**Your MYSQL ADMIN instance will be available at**
https://127.0.0.1:8080/dbadmin/
**Your SWAGGER instance will be available at**
https://127.0.0.1:8080/swagger/

Expand All @@ -60,8 +61,8 @@ Change ip and port accordingly if host and port differ.

**Your `tests` table will be available at**
https://api.example.com/records/tests (no need of explicit api.php)[^1]
**Your PHPMYADMIN instance will be available at**
https://api.example.com/phpmyadmin/
**Your MYSQL ADMIN instance will be available at**
https://api.example.com/dbadmin/
**Your SWAGGER instance will be available at**
https://api.example.com/swagger/

Expand Down
25 changes: 16 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,24 @@ services:
networks:
- php-api-network

phpmyadmin:
container_name: phpmyadmin_treeqlqs
image: phpmyadmin/phpmyadmin
#phpmyadmin:
# container_name: dbadmin_treeqlqs
# image: phpmyadmin/phpmyadmin
# restart: always
# environment:
# PMA_HOST: mysql_treeqlqs
# PMA_ABSOLUTE_URI: ${SERVER_NAME}dbadmin/
# networks:
# - php-api-network
# depends_on:
# - web

adminer:
container_name: dbadmin_treeqlqs
image: adminer
restart: always
environment:
PMA_HOST: mysql_treeqlqs
PMA_ABSOLUTE_URI: ${SERVER_NAME}phpmyadmin/
networks:
- php-api-network
depends_on:
- web
ADMINER_DEFAULT_SERVER: mysql_treeqlqs

swagger:
container_name: swagger_treeqlqs
Expand Down
4 changes: 2 additions & 2 deletions nginx/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ server {
proxy_pass http://swagger_treeqlqs:8080/;
}

location ^~ /phpmyadmin/ {
location ^~ /dbadmin/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://phpmyadmin_treeqlqs/;
proxy_pass http://dbadmin_treeqlqs:8080/;
}
}

0 comments on commit a5d4c88

Please sign in to comment.