Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't write to Drupal files' directory #544

Open
Cleets opened this issue Mar 7, 2023 · 0 comments
Open

Can't write to Drupal files' directory #544

Cleets opened this issue Mar 7, 2023 · 0 comments

Comments

@Cleets
Copy link

Cleets commented Mar 7, 2023

OS type
Windows

Drupal version
8/9

Codebase
mounted codebase

Describe the bug
Drupal installs fine and the volumes that are defined for the php and nginx containers can be read, but they cannot be written to. This effects the ability to upload files from within Drupal as well as an inability to aggregate css and js files.

Output of docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.10.3)
  compose: Docker Compose (Docker Inc., v2.15.1)
  dev: Docker Dev Environments (Docker Inc., v0.1.0)
  extension: Manages Docker extensions (Docker Inc., v0.2.18)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.25.0)
  scout: Command line tool for Docker Scout (Docker Inc., v0.6.0)

Server:
 Containers: 9
  Running: 8
  Paused: 0
  Stopped: 1
 Images: 8
 Server Version: 20.10.23
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.49-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.63GiB
 Name: docker-desktop
 ID: TRNT:QNDZ:Q32G:UFDM:7BTR:NHXZ:BAQA:QZMB:TZSR:H4EQ:ZUME:AXTH
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

**Contents of your `docker-compose.yml`**

version: "3.38"
volumes:
drupalfiles:
driver_opts:
o: bind
type: none
device: ./

services:
mariadb:
image: wodby/mariadb:$MARIADB_TAG
container_name: "${PROJECT_NAME}_mariadb"
stop_grace_period: 30s
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
MYSQL_USER: $DB_USER
MYSQL_PASSWORD: $DB_PASSWORD
volumes:
- ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.

php:
user: root
command: 'sh -c "/var/www/html/phpcontainerconfig.sh"'
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_php"
environment:
PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
DB_HOST: $DB_HOST
DB_PORT: $DB_PORT
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
DB_DRIVER: $DB_DRIVER
PHP_FPM_USER: root
PHP_FPM_GROUP: root
expose:
- 9000
volumes:
- drupalfiles:/var/www/html:cached

crond:
image: wodby/drupal-php:$PHP_TAG
container_name: "${PROJECT_NAME}_crond"
environment:
CRONTAB: "0 * * * * drush -r /var/www/html/web cron"
command: sudo -E LD_PRELOAD=/usr/lib/preloadable_libiconv.so crond -f -d 0
volumes:
- drupalfiles:/var/www/html:cached

nginx:
user: root
image: wodby/nginx:$NGINX_TAG
container_name: "${PROJECT_NAME}_nginx"
depends_on:
- php
environment:
NGINX_STATIC_OPEN_FILE_CACHE: "off"
NGINX_ERROR_LOG_LEVEL: debug
NGINX_BACKEND_HOST: php
NGINX_SERVER_ROOT: /var/www/html/web
NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET
volumes:
- drupalfiles:/var/www/html:cached
labels:
- "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(${PROJECT_BASE_URL})"

mailhog:
image: mailhog/mailhog
container_name: "${PROJECT_NAME}_mailhog"
labels:
- "traefik.http.services.${PROJECT_NAME}_mailhog.loadbalancer.server.port=8025"
- "traefik.http.routers.${PROJECT_NAME}_mailhog.rule=Host(mailhog.${PROJECT_BASE_URL})"

drupal-node:
image: wodby/drupal-node:$DRUPAL_NODE_TAG
container_name: "${PROJECT_NAME}_drupal_nodejs"
labels:
- "traefik.http.routers.${PROJECT_NAME}_drupal_node.rule=Host(drupal_node.${PROJECT_BASE_URL})"
environment:
NODE_SERVICE_KEY: node-service-key

portainer:
image: portainer/portainer-ce
container_name: "${PROJECT_NAME}_portainer"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.http.routers.${PROJECT_NAME}_portainer.rule=Host(portainer.${PROJECT_BASE_URL})"

traefik:
image: traefik:v2.0
container_name: "${PROJECT_NAME}_traefik"
command: --api.insecure=true --providers.docker
ports:
- '8000:80'
volumes:
- /var/run/docker.sock:/var/run/docker.sock


**Contents of your `.env`**

Paste here

DB_NAME=devportal
DB_USER=drupal
DB_PASSWORD=drupal
DB_ROOT_PASSWORD=password
DB_HOST=mariadb
DB_PORT=3306
DB_DRIVER=mysql

MARIADB_TAG=10.9-3.23.0

DRUPAL_TAG=10-4.52.0
PHP_TAG=8.1-dev-4.38.2

NGINX_TAG=1.23-5.29.0
NGINX_VHOST_PRESET=drupal9

ELASTICSEARCH_TAG=7-5.18.6

KIBANA_TAG=7-5.18.6

NODE_TAG=18-dev-1.16.0

ADMINER_TAG=4-3.24.2
APACHE_TAG=2.4-4.10.4
ATHENAPDF_TAG=2.16.0
DRUPAL_NODE_TAG=1.0-2.0.0
MEMCACHED_TAG=1-2.13.5
OPENSMTPD_TAG=6-1.14.4
RSYSLOG_TAG=latest
SELENIUM_CHROME_TAG=3.141
WEBGRIND_TAG=1-1.29.2
XHPROF_TAG=3.7.3
ZOOKEEPER_TAG=3.8


**Logs output `docker-compose logs`**

Paste here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant