Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM php:8-apache

RUN docker-php-ext-install mysqli

EXPOSE 80/tcp
EXPOSE 443/tcp
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# PHP Docker Full Stack

See https://youtu.be/2Bxh5FNGznQ for a full walk through on spinning up this full-stack Php web app with MySql and phpMySql

## Requirements:

* Docker

## Getting Started

To run this code, run command: `docker-compose up` from the shell within the directory of this project after cloning it.
13 changes: 9 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: '3'
services:
db:
db:
container_name: mysql
image: mysql:latest
environment:
- MYSQL_DATABASE=php_docker
Expand All @@ -10,16 +11,20 @@ services:
volumes:
- "./db:/docker-entrypoint-initdb.d" # this is how we persist a sql db even when container stops
www:
image: php:apache
container_name: php
build:
context: .
dockerfile: Dockerfile
volumes:
- "./:/var/www/html" # sync the current dir on local machine to the dir of container
- "./src:/var/www/html" # sync the current dir on local machine to the dir of container
ports:
- 80:80
- 443:443 # for future ssl traffic
phpmyadmin:
container_name: phpmyadmin
image: phpmyadmin/phpmyadmin
ports:
- 8001:80
environment:
- PMA_HOST=db
- PMA_PORT=3306
- PMA_PORT=3306
File renamed without changes.
File renamed without changes.