nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Update 30-ownership.sh to make chown optional

Open ian351c opened this issue 1 year ago • 6 comments

Make setting file permissions optional with SKIP_FILE_OWNERSHIP environment variable.

ian351c avatar Jun 05 '24 14:06 ian351c

This is so that I can use NPM in a VM that has "shared folders".

ian351c avatar Jun 05 '24 14:06 ian351c

Also there is a big problem with mariadb

On logs it shows that cannot create table, but that because of file ownership, mariadb cannot access those files, that live in /var/lib/mysql

app_1  | [6/8/2024] [2:40:17 AM] [Global   ] › ✖  error     create table `migrations` (`id` int unsigned not null auto_increment primary key, `name` varchar(255), `batch` int, `migration_time` timestamp) - ER_CANT_CREATE_TABLE: Can't create table `npm`.`migrations` (errno: 13 "Permission denied")

example docker-compose.yml

  app:
    image: 'jc21/nginx-proxy-manager:2.11.2' 
    ...
    environment:
      PUID: 1000
      PGID: 1000
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
    volumes:
      - ./data:/data

  db:
    image: 'jc21/mariadb-aria:10.11.5'
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
      MARIADB_AUTO_UPGRADE: '1'
    volumes:
      - ./data/mysql:/var/lib/mysql

On start application Setting ownership by envs PUID: 1000 PGID: 1000 also for ./data/mysql directory ant thats why mysql is not working anymore, because it runs as mysql user

As dirty workaround, to at least nginx proxy manager starts and works is to

# after running docker compose up need to change owner for mysql
docker exec -it nginx-proxy-manager_db_1 chown -vR mysql /var/lib/mysql/

rrolla avatar Jun 08 '24 09:06 rrolla

Yeah the mysql folder should not be within the data folder for this very reason.

The documentation doesn't do this either (anymore)

jc21 avatar Jun 25 '24 00:06 jc21

CI Error:

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
certbot-node: Pulling from nginxproxymanager/nginx-full
Digest: sha256:eaa2ebcb50dd87557c9a8f95a3230128d94cac1ea17800261c036e59378e7d49
Status: Image is up to date for nginxproxymanager/nginx-full:certbot-node
docker.io/nginxproxymanager/nginx-full:certbot-node
[1;34m❯ [1;36mBuilding Frontend ...[0m
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/tabler/tabler.git /usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309
Directory: /app/frontend
Output:
Cloning into '/usr/local/share/.cache/yarn/v6/.tmp/e11a93799a52aa978c82015e29fbe309'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 7999 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

I ended up build my own image out of one provided, running chown, then cutting it out. Running it within TrueNAS, try yourself, it takes forever to start without cutting it out.

kirmorozov avatar Mar 20 '25 05:03 kirmorozov

skipping the ownership would help to include custom configs via docker swarm config mounts!

crazychatting avatar Apr 16 '25 11:04 crazychatting