I'm working on a docker project and I want to run a php file which will configure the database for the project.
My Docker file :
FROM php:7.2-apache
LABEL maintainer="admin@ksoftlabs.com"
COPY site/ /var/www/html
RUN chmod -R 777 /var/www/html
RUN docker-php-ext-install mysqli
COPY 000-default.conf /etc/apache2/sites- available/000-default.conf
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
My docker-compose.yml
version: '3.1'
services:
db:
image: mysql
command:
--default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: group_db
server:
image : apache
ports:
- "80:80"
I want to run the install.php which will be in /var/www/html/ directory. How can I do that?
Edit : I want to run this file automatically after the container is up