zmdockerfiles icon indicating copy to clipboard operation
zmdockerfiles copied to clipboard

wrong permissions within container for web-site files

Open karakuraizer opened this issue 2 years ago • 0 comments

docker-compose.yml


services:
  db:
    image: mysql/mysql-server:5.7
    restart: on-failure
    hostname: db
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /usr/share/zoneinfo:/usr/share/zoneinfo:ro
      - $PWD/mysql:/var/lib/mysql
      - $PWD/conf/mysql/:/etc/mysql/
#      - $PWD/log:/var/log
    environment:
     - MYSQL_USER=zmuser
     - MYSQL_PASSWORD=123123
     - MYSQL_DATABASE=zm
     - MYSQL_ROOT_PASSWORD=123123
     - MYSQL_ROOT_HOST=%
  web:
    image: zoneminderhq/zoneminder:latest-ubuntu18.04
    mem_limit: 14gb
    #shm_size: 1024M
    #memswap_limit: 4gb
    oom_kill_disable: true
    restart: on-failure
##    entrypoint: ["sleep","1d"]
    command: ["chown -R www-data:www-data /usr/share/zoneminder/www"]
    ports:
      - 8080:80
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - $PWD/log:/var/log/zm
      - $PWD/backups:/var/backups
      - $PWD/zoneminder:/var/cache/zoneminder
      - $PWD/zoneminder/cache:/usr/share/zoneminder/www/cache
      - $PWD/motionstream:/etc/service/motionstream
      - $PWD/ssmtp:/etc/ssmtp
      - type: tmpfs
        target: /dev/shm
    environment:
        #- SERVICE_PORTS="80"
      - ZM_DB_HOST=db
      - ZM_DB_NAME=zm
      - ZM_DB_USER=zmuser
      - ZM_DB_PASS=123123
    depends_on:
      - db

FIXed issue with docker exec : chown -R www-data:www-data /usr/share/zoneminder/www

OR in compose file:

command: ["chown -R www-data:www-data /usr/share/zoneminder/www"]

also got an issue with running startup script for db (creating tables etc...) forgot how resolved it...guess the same way like docker exec -it zm_db_1 ... and run initial sql

karakuraizer avatar Oct 11 '23 12:10 karakuraizer