wordpress on docker permission issues

Discussion in 'Technical' started by conductive, Jul 27, 2023.

  1. conductive

    conductive Member HowtoForge Supporter

    Using the following docker compose file I can make a working wordpress site on AWS.
    Unfortunately I can not add, update or delete plugins.
    If I change all file permissions in the wordpress directory to 777 everything works.

    The the new files created are owned by user:
    daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin

    Simply changing wordpress files to user:
    www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
    does not fix the problem.

    Any Ideas on how to make this work?

    thanks.

    ```
    version: "3"

    services:
    nginx:
    image: nginx:latest
    ports:
    - 80:80
    - 443:443
    volumes:
    - ./wordpress:/var/www/wordpress
    - ./websites:/var/www/websites
    - ./nginx-config/default.conf:/etc/nginx/conf.d/default.conf
    mysql:
    image: mysql:latest
    environment:
    MYSQL_DATABASE: wpdb
    MYSQL_USER: wpuser
    MYSQL_PASSWORD: secret
    MYSQL_ROOT_PASSWORD: secret
    volumes:
    - ./dbdata:/var/lib/mysql
    php-fpm:
    image: bitnami/php-fpm:latest
    volumes:
    - ./wordpress:/var/www/wordpress

    ```
     

Share This Page