visiblevc / wordpress-starter

A slightly less shitty wordpress development workflow
688 stars 167 forks source link

Theme from volumes deleted #158

Open keskistok opened 5 years ago

keskistok commented 5 years ago

Im adding the theme Im developing using the volumes like in the below example.

volumes:
            - ./data:/data
            - ./code/stokpress:/app/wp-content/themes/stokpress

But when I run the docker-compose up command the theme gets removed in Checking themes step. Since the theme is not published or available on an external domain im not able to add it in the THEMES part. This is when Im starting from a clean database where the theme has never ben activated.

This is the output during the installation:

wordpress_1   | ==> Checking themes
wordpress_1   | Warning: Ignoring ambiguous empty slug value.
wordpress_1   | Success: Theme already installed.
wordpress_1   |          Deleted 'stokpress/resources' theme.
wordpress_1   | Success: Deleted 1 of 1 themes.

The theme is built on the Sage 9 starter theme from Roots.it and that makes the theme name listed like this using wp cli:

admin@b7d504259eb0:/app$ wp theme list
+-------------------+----------+--------+---------+
| name              | status   | update | version |
+-------------------+----------+--------+---------+
| stokpress/resources | inactive | none   | 9.0.9   |
+-------------------+----------+--------+---------+
dsifford commented 5 years ago

Hard to tell without the full docker-compose.yml. Can you try maybe not having your theme named with a slash?

keskistok commented 5 years ago

Here is the full composer:

version: "3"
services:
    wordpress:
        image: visiblevc/wordpress

        # required for mounting bindfs
        cap_add:
            - SYS_ADMIN
        devices:
            - /dev/fuse
        # required on certain cloud hosts
        security_opt:
            - apparmor:unconfined

        ports:
            - 9080:80
        volumes:
            - ./data:/data
            - ./code/stokpress:/app/wp-content/themes/stokpress
            - ./scripts:/docker-entrypoint-initwp.d
        environment:
            DB_NAME: wordpress
            DB_PASS: root
            PLUGINS: >-
                classic-editor
                safe-svg
                [soil]https://github.com/roots/soil/archive/3.7.3.zip

    db:
        image: mariadb:10 # or mysql:5.7
        volumes:
            - data:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: root
        ports: 
            - 5306:3306

    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        ports:
            - 32222:80

volumes:
    data:

Im not really sure why the theme name ends up like that, but I guess its because of the specific file structure used by the sage theme.

https://github.com/roots/sage/blob/master/resources/style.css