Skip to content

Adding custom volume changes wp-content owner to root #358

@antonlukin

Description

@antonlukin

I am using docker-compose to install WordPress.
When I add the volume with my custom developed theme, wp-content and wp-content/themes directories owner changes to root. So I can't upload images and update core.

Using docker just for developing I want to have ability to set my custom theme's owner to www-data, but I can't to set in on my host system, because I don't have such a system user.

version: '3'
services:
  database:
    image: mysql:5.7
    volumes:
        - database:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: wordpress
    networks:
      - back

  wordpress:
    depends_on:
      - database
    image: wordpress:latest
    restart: always
    volumes:
      - wordpress:/var/www/html/wp-content:rw
      - ./app:/var/www/html/wp-content/themes/instapress:ro
    environment:
      WORDPRESS_DB_HOST: database:3306
      WORDPRESS_DB_PASSWORD: wordpress
    ports:
      - 80:80
    networks:
      - back

volumes:
  database: {}
  wordpress: {}

networks:
  back:

Help me to understand how I can change dynamically my custom theme directory owner, please

docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions