V
V
Vladimir Mogilev2018-03-10 15:50:35
Debian
Vladimir Mogilev, 2018-03-10 15:50:35

Working with the project through docker-compose volume. How right?

Recently moved to Debian and ran into a problem while trying to write docker-compose.yaml .
The file itself works fine, the containers rise, but when processing the volume block, it creates a directory on the host with the container group and user (or generally root). This is where the problem begins. How do I actually edit the files?
Here is my docker-compose.yaml

version: '3.4'
services:
  db:
    image: mariadb:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    working_dir: /var/www/html
    volumes:
      - "./www/:/var/www/html"
      - "./plugins/:/var/www/html/wp-content/plugins"
      - "./themes/:/var/www/html/wp-content/themes"
    ports:
      - 8000:80
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080

I work with PhpStorm and try to fully understand it and use it to the fullest, so I also work with docker in it. And I noticed another moment. If I run this particular config through a regular console, then the user and group of listened folders www-data and if I run it through a storm, the files get the root user
Do I need to somehow modify the config?
Or maybe I don’t understand something at all, then tell me what?
Thanks in advance.
PS If the question is from a Nubian, then please don't swear, I've only moved to Debian for a couple of months.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Mogilev, 2018-03-11
@AkinaySau

So far, the only solution that I have found is a crutch
Share the rights to the directory in this way: sudo chmod ug+w ./www
But as for me, the solution is clumsy and it is necessary to have a group on the host (I have a server, so the presence of the www-data group did not cause problems )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question