Created
April 7, 2024 09:45
-
-
Save ArslanKathia/050d778d9dda9b9bd9ef3a669ba7cf24 to your computer and use it in GitHub Desktop.
Install Web-Server Php,mysql and phpmyadmin on docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------- | |
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