Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ArslanKathia/050d778d9dda9b9bd9ef3a669ba7cf24 to your computer and use it in GitHub Desktop.
Save ArslanKathia/050d778d9dda9b9bd9ef3a669ba7cf24 to your computer and use it in GitHub Desktop.
Install Web-Server Php,mysql and phpmyadmin on docker
-------------------
docker-compose.yml
-------------------
version: "3.9"
services:
webserver:
container_name: PHP-webserver
build:
context: .
dockerfile: Dockerfile
volumes:
- ./myCalculator:/var/www/html
ports:
- 8085:80
depends_on:
- mysql-db
mysql-db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test_database
MYSQL_USER: db_user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
phpmyadmin:
image: phpmyadmin/phpmyadmin
links:
- mysql-db
ports:
- "8081:80"
environment:
PMA_HOST: mysql-db
MYSQL_ROOT_PASSWORD: password
--------------------
Dockerfile
--------------------
FROM php:8.2-apache
RUN a2enmod rewrite
RUN docker-php-ext-install mysqli pdo pdo_mysql
WORKDIR /var/www/html
COPY ../myCalculator .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment