简体   繁体   中英

Docker WordPress - mount application code?

I am currently developing a WordPress website. For easy theme development I compose the WordPress application in a Docker Container and I mount the theme folder.

Now, I'm not gonna host the website via Docker. Do you see a problem in mounting the whole application folder so that I can access the whole code (and upload it to my server)?

Of course, I'll keep all files and folders out of GIT, except the wp-content folder.

Here is an excerpt of my docker-compose.yml :

version: '3'
services:
  wordpress:
    image: visiblevc/wordpress:latest
    ports:
      - 8080:80
      - 443:443
    volumes:
      - ./data:/data
      - ./wordpress:/app
...

I'm looking forward to hearing from you!

Thank you so much in advance!

Cheers!

Niels

I don't see any critical problem in doing that, but there are a couple of downsides/risk that come to mind for me.

  1. It's possible to accidentally bump WP core files and ship them, which isn't good.

  2. It clutters up your local development environment. Rather than having your WP core code just live in the container locally, you have to navigate around it locally too.

Ideally, I'd think about automating this somewhere, where you only move that wp-content directory, and have the rest of core built by something else on deploy. If not Docker, may be Composer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM