Open ralyodio opened 4 years ago
I know what you mean, it surprises me that their example code (apache at least) is not working from the get go.
Here is what I recommend: Create a dockerfile like this:
FROM matomo:3.13
RUN chown -R www-data:www-data /var/www/html
RUN find /var/www/html/tmp -type f -exec chmod 644 {} \; || true
RUN find /var/www/html/tmp -type d -exec chmod 755 {} \; || true
RUN find /var/www/html/tmp/assets/ -type f -exec chmod 644 {} \; || true
RUN find /var/www/html/tmp/assets/ -type d -exec chmod 755 {} \; || true
RUN find /var/www/html/tmp/cache/ -type f -exec chmod 644 {} \; || true
RUN find /var/www/html/tmp/cache/ -type d -exec chmod 755 {} \; || true
RUN find /var/www/html/tmp/logs/ -type f -exec chmod 644 {} \; || true
RUN find /var/www/html/tmp/logs/ -type d -exec chmod 755 {} \; || true
RUN find /var/www/html/tmp/tcpdf/ -type f -exec chmod 644 {} \; || true
RUN find /var/www/html/tmp/tcpdf/ -type d -exec chmod 755 {} \; || true
RUN find /var/www/html/tmp/templates_c/ -type f -exec chmod 644 {} \; || true
RUN find /var/www/html/tmp/templates_c/ -type d -exec chmod 755 {} \; || true
You could probably remove most of these RUNs but they dont hurt so I just left them as is.
above you hvae given basic image as matomo, what if I need PHP apache as base image, than how can i correct these tmp folder errors
I'm getting the same issue here with the latest image...
docker-compose is as follows (using nginx proxy manager so only exposing port)
version: '3'
services:
app:
image: matomo:latest
restart: unless-stopped
environment:
- MATOMO_DATABASE_HOST=db
- MATOMO_DATABASE_TABLES_PREFIX=mat_
- MATOMO_DATABASE_USERNAME=matomo-CHANGE
- MATOMO_DATABASE_PASSWORD=matomo-CHANGE
- MATOMO_DATABASE_DBNAME=matomo
volumes:
- /home/ediflyer/containers/matomo/app:/var/www/html
links:
- db:db
expose:
- 80/tcp
networks:
- nginx-proxy-manager_default
db:
image: yobasystems/alpine-mariadb:latest
restart: unless-stopped
environment:
MYSQL_DATABASE: matomo
MYSQL_USER: matomo-CHANGE
MYSQL_PASSWORD: matomo-CHANGE
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- /home/ediflyer/containers/matomo/db:/var/lib/mysql
networks:
- nginx-proxy-manager_default
networks:
nginx-proxy-manager_default:
external: true
name: nginx-proxy-manager_default
EDIT - OK so I removed all containers and existing files and recreated the stack & that seemed to do the trick.
DOcker should be running everything as root so I'm not sure why there are permission issues inside the container.