Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versionpress is not docker mount friendly during activation #1456

Open
ricxsar opened this issue Jun 19, 2019 · 4 comments
Open

Versionpress is not docker mount friendly during activation #1456

ricxsar opened this issue Jun 19, 2019 · 4 comments

Comments

@ricxsar
Copy link

ricxsar commented Jun 19, 2019

I tried to create a wordpress docker image with versionpress on it. I'm only interested on versionpress files so I created a mount point of git on wordpress root folder (/var/www/html/.git) and versionpress db folder (vpdb) on wp-content folder (/var/www/html/wp-content/vpdb).

On the checklist says This website is already versioned in Git even though the .git folder and vpdb is empty.

image

And also when i tried to activate it, it will try to delete the mounted folders which throws an error since it is not a normal folder.

I'm proposing is instead of deleting the folder, it should only delete the files inside it.

Another thing is when the docker image is deployed under a load balancer, it will not be successfully activated because mostly of the load balancers have limits on response time.

Please take the above situations on your design so that versionpress can be used on docker images.

More power and God bless us all.

@ricxsar
Copy link
Author

ricxsar commented Jun 19, 2019

To solve the problem when behind a load balancer, you should introduce a WP-CLI command which activates versionpress similar to the Wordpress Admin Plugin Activation.

@olexiyb
Copy link

olexiyb commented Oct 5, 2019

Just create Dockerfile

FROM wordpress:latest

RUN apt-get update && apt-get install libldap2-dev -y
RUN docker-php-ext-install ldap
RUN apt-get install -y git
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && mv wp-cli.phar /usr/local/bin/wp
RUN wp core install --url="http://localhost:8000" --title=Site --admin_user=admin --admin_password=admin --admin_email=admin@gmail.com
RUN wp plugin install https://github.com/versionpress/versionpress/releases/download/4.0-beta2/versionpress-4.0-beta2.zip --activate
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

And docker-compose.yml

version: '3.3'

services:
  db:
    image: mysql:5.7
    container_name: wordpressdb
    volumes:
      - db:/var/lib/mysql
    restart: always
    env_file:
      - ".env"
    environment:
      - MYSQL_ROOT_PASSWORD
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=wordpress
      - MYSQL_PASSWORD

  wordpress:
    depends_on:
      - db
    image: blaizepress
    container_name: wordpressweb
    build: ./
    ports:
      - "8000:80"
    restart: always
    env_file:
      - ".env"
    environment:
      - WORDPRESS_DB_HOST=db:3306
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}
      - WORDPRESS_DB_NAME=wordpress
    volumes:
      - web:/var/www/html
volumes:
  web:
  db:

@ricxsar
Copy link
Author

ricxsar commented Oct 7, 2019

@olexiyb I think Dockerfile only activates the plugin but not activating the full VersionPress functionality and also I don't want to mount the whole /var/www/html, only the VersionPress files like I've said above due to personal reasons.

@pschoffer
Copy link

pschoffer commented Mar 2, 2020

I was checking this project (loving it btw) and I think I was planning to use it in a similar way as you @ricxsar. I guess this might be old news by now., but there is wp vp activate command you can use in your Dockerfile to get fully activated versionpress. It gets a bit tricky to make sure wordpress can use the git repo, if you run as a root but doing a chown -R www-data . (in apache flavour) make it work it seems

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants