Download this script directly with wget or curl, for example:
wget https://raw.githubusercontent.com/stuntcoders/stunt_utils/main/stunt_wp_autologin/autologin.phpNext, move script into autologin folder:
mkdir autologin
mv autologin.php autologin/index.phpIn your docker-compose.yml file in wordpress service add:
services:
wordpress:
...
+ command: bash -c "curl -O https://raw.githubusercontent.com/stuntcoders/stunt_utils/main/stunt_wp_autologin/autologin.php -o autologin/index.php && \
apachectl -DFOREGROUND"
...
environment:
+ WORDPRESS_LOGIN_URL: 'domain name'
+ WORDPRESS_LOGIN_NAME: 'db admin name'
...
volumes:
...
+ - autologin:/var/www/autologinIf you're building your own image locally, you could add script setup in Dockerfile
RUN curl -O https://raw.githubusercontent.com/stuntcoders/stunt_utils/main/stunt_wp_autologin/autologin.php -o autologin/index.php