Skip to content

brunoandradebr/php-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP | MariaDB | Nginx | Docker

php MariaDB Nginx Docker

This is a simple php monolithic environment ready to develop using mariadb like in the old days 💀

⚠️ This is not ready for production, just for fun ⚠️


How to run

1 - Clone this repository
git clone [email protected]:brunoandradebr/php-docker.git .
2 - Create a .env file
  • 📂.database/
  • 📂.docker/
  • 📂 src/
  • 📄.env
DB_USER=admin; # don't use root name. will conflict with default root user
DB_PASS=admin; # defines user and root password as same
DB_NAME=app;
3 - Start docker services
# script for docker compose up
sh dev.sh
4 - Run migrations to create tables
sh .database/migrate.sh
5 - Run seeds to populate tables
sh .database/seed.sh
6 - Open browser
http://localhost

That's it!


Images

  • php:fpm - (FastCGI Process Manager) Process php files
  • nginx:1.25-alpine - Web Server
  • mariadb:latest - Database

Services

  • php-fpm
  • web
  • database

Extensions

  • mysqli
  • pdo
  • pdo_mysql

Database

Tables are generated based on files inside .database folder.

📂 .database/migrations

  # For table creation. All sql files will be executed in alphabetical order.
  1-create-table-contacts.sql
  2-create-table-posts.sql

📂 .database/seeds

  # For table population. All sql files will be executed in alphabetical order.
  1-populate-table-contacts.sql
  2-populate-table-posts.sql

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published