DockerFile:
FROM php:7.2-apache
RUN apt-get update && apt-get install -y
RUN docker-php-ext-install mysqli pdo_mysql
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
RUN mkdir -p /app \
&& mkdir -p /app/moe-php-mysql-demo \
&& mkdir -p /app/moe-php-mysql-demo/www
#WORKDIR ./www
COPY . /app/moe-php-mysql-demo/www
RUN cp -r /app/moe-php-mysql-demo/www/* /var/www/html/.
RUN chmod -R 0755 /var/www/html/cuestionario/
RUN apt install nano
docker-compose.yml
version: "3.2"
services:
php:
#build:
# context: .
#image: amakundu/moe-php-mysql-demo:1.0.0
#image: php:7.2-apache
build:
context : .
dockerfile: ./Dockerfile
networks:
- frontend
- backend
environment:
- MYSQL_HOST=moe-mysql-app
- MYSQL_USER=moeuser
- MYSQL_PASSWORD=moepass
- MYSQL_DB=moe_db
#volumes:
#- ./www/:/var/www/html/
#- ./php.ini:/usr/local/etc/php/php.ini
ports:
- "80:80"
container_name: moe-php-app
mysql:
image: mysql:5.7
#command: "docker-php-ext-install mysqli"
networks:
- backend
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_USER=moeuser
- MYSQL_PASSWORD=moepass
- MYSQL_DATABASE=moe_db
container_name: moe-mysql-app
phpmyadmin:
image: phpmyadmin/phpmyadmin:4.7
depends_on:
- mysql
networks:
- backend
ports:
- "30002:80"
environment:
- PMA_HOST=moe-mysql-app
- PMA_PORT= 3306
- MAX_EXECUTION_TIME = 0
- MEMORY_LIMIT = 512M
- UPLOAD_LIMIT = 512M
volumes:
- /sessions
container_name: moe-phpmyadmin-app
networks:
frontend:
backend:
bug image
/chaea
Tried with windows 10 xampp and it works. But not with ubuntu