Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question