Script always running on ENTRYPOINT dockerfile but i only want him to run once
Andrew Henderson
I tried to set up a Wordpress solution (installing by myself and not using an official image). I have one container with Apache, PHP and Mariadb-client (to interrogate Mariadb-server from another container)
I have another container with Mariadbon it.
I use wp-cli to configure Wordpress website but when i build my docker image, I can't execute the command (inside sh file) which is
wp core config --allow-root --dbname=$MYSQL_DATABASE --dbuser=$MYSQL_USER --dbpass=$MYSQL_PASSWORD --dbhost=172.20.0.2 --dbprefix=wp --path=/var/www/html/wordpressbecause my Mariadb container isn't up.
So I tried to run this script with entrypoint parameters and when I do my docker-compose up, my script is played and I have the message:
apache-php_SDV | Success: Generated 'wp-config.php' file.
apache-php_SDV | Error: The 'wp-config.php' file already exists.My script is played every second, I tried to use CMD before and it doesn't work, it's like CMD wasn't run
I have the same result if I want to put CMD after ENTRYPOINT, I can run my script only when both containers are up.
I also tried to use command on my docker-compose.yml but not helpful. Does anyone have a solution?