Title: WordPress and Docker
Last modified: December 6, 2021

---

# WordPress and Docker

 *  Resolved [aderchox](https://wordpress.org/support/users/aderchox/)
 * (@aderchox)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/wordpress-and-docker/)
 * 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 4 years, 5 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Developing with WordPress
      topic

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [a2hostingrj](https://wordpress.org/support/users/a2hostingrj/)
 * (@a2hostingrj)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/wordpress-and-docker/#post-15140778)
 * > (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](https://wordpress.org/support/users/aderchox/)
 * (@aderchox)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/wordpress-and-docker/#post-15141056)
 * >  I am in the same scenario as well right now. This is my development flow
 * This is great [@a2hostingrj](https://wordpress.org/support/users/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 4 years, 5 months ago by [aderchox](https://wordpress.org/support/users/aderchox/).
 *  [a2hostingrj](https://wordpress.org/support/users/a2hostingrj/)
 * (@a2hostingrj)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/wordpress-and-docker/#post-15141125)
 * > 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](https://wordpress.org/support/users/aderchox/)
 * (@aderchox)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/wordpress-and-docker/#post-15141358)
 * [@a2hostingrj](https://wordpress.org/support/users/a2hostingrj/) Thank you, your
   answers were very helpful 😊
    -  This reply was modified 4 years, 5 months ago by [aderchox](https://wordpress.org/support/users/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.

## Tags

 * [docker](https://wordpress.org/support/topic-tag/docker/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [aderchox](https://wordpress.org/support/users/aderchox/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/wordpress-and-docker/#post-15141358)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
