• Resolved aderchox

    (@aderchox)


    Hi, assuming WordPress is in a docker container, and I want the theme to be developable as well, which files should go in a volume and which ones in the container itself? Let’s say I put the wp-content in a volume, but if I have my own custom theme and it evolves with time (it is version controlled), since that theme is in a volume, a change to that theme will not be a change to “the content of the docker image” and so will not trigger an image re-build (in an automatic setup, but even if it did, it would not have an effect on the image). So I don’t know in this scenario, how new changes to the theme can be reflected to the production server.

    • This topic was modified 2 years, 11 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 4 replies - 1 through 4 (of 4 total)
  • (it is version controlled), since that theme is in a volume, a change to that theme will not be a change to “the content of the docker image” and so will not trigger an image re-build (in an automatic setup, but even if it did, it would not have an effect on the image). So I don’t know in this scenario, how new changes to the theme can be reflected to the production server.

    I am in the same scenario as well right now. This is my development flow:

    1. Work on my local development site.
    2. Test the changes. If everything works well, I push to my repository (dev)
    3. Review changes. If nothing breaks, merge with production/main branch
    4. On my server, pull the changes from production/main.
    5. Rebuild the docker image. (Database is in its own docker container, so it won’t be affected by this).

    Thread Starter aderchox

    (@aderchox)

    I am in the same scenario as well right now. This is my development flow

    This is great @a2hostingrj, yes I came up with this flow as well through my searches some time after I asked this question. Thanks a lot for sharing your flow. ?? Only one more question, how do you deploy “the very first time”? I mean, the very first time I’m going to deploy my project, I feel I do need to do some things manually, am I correct? For example, I have git-ignored most WordPress core files from the git repository, also, I have docker-ignored the wp-content directory, however as we know, it MUST be present in the end anyway…, so the very first time I’m deploying my project, there’s no way other than adding these files manually, e.g., using other means such as npm install and wp core install and even sometimes “uploading” some files (probably could be made much less painful with Ansible) manually and so on… to get it “started”. May I know how you take this initial step as well?

    • This reply was modified 2 years, 11 months ago by aderchox.

    git-ignored most WordPress core files from the git repository

    That’s how I usually do it, so that I can safely migrate to another container (if required)

    Using other means such as npm install and wp core install and even sometimes “uploading” some files (probably could be made much less painful with Ansible) manually and so on… to get it “started”. May I know how you take this initial step as well?

    For the first time, it depends of your preference. For example, I tell the dockerfile to install composer or npm, but I install the packages/libraries/dependencies manually by using the container bash. I’ve seem others that add all of the commands in the Dockerfile.

    Thread Starter aderchox

    (@aderchox)

    @a2hostingrj Thank you, your answers were very helpful ??

    • This reply was modified 2 years, 11 months ago by aderchox. Reason: to mark as resolved
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress and Docker’ is closed to new replies.