ItsEcholot / ContainerNursery

Puts Docker Containers to sleep and wakes them back up when they're needed
MIT License
94 stars 6 forks source link

Error: connect EACCES /var/run/docker.sock #39

Closed warlordattack closed 1 year ago

warlordattack commented 1 year ago
1/ 

Nursery : 
version: "2.1"
services:
  srv_nursery:
    user: ${PUID}:${PGID}
    container_name: ${C_NUR}
    image: ${C_NUR_IMG}
    restart: ${C_ALL_RESTART}
    hostname: ${C_NUR_HOST}
    ports:
      - ${C_NUR_80}:80
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${REP_APPDATA}/${C_NUR}:/usr/src/app/config
    environment:
      - CN_PORT=${C_NUR_80}
      - PUID=${PUID}
      - PGID=${PGID}
      - UMASK=${UMASK}
      - TZ=${TZ}
    networks:
      - web
networks: 
  web: 
    external: true

config.yml : 
proxyHosts:
  - domain: dn-petio.monsite.ovh
    containerName: g-petio
    proxyHost: glu
    proxyPort: 7777
    timeoutSeconds: 600
    stopOnTimeoutIfCpuUsageBelow: 200

Error log : 

INFO [2022-11-29 18:23:33.103 +0100]: (Re)loading hosts, clearing all existing hosts first
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^
Error: connect EACCES /var/run/docker.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1195:16) {
  errno: -13,
  code: 'EACCES',
  syscall: 'connect',
  address: '/var/run/docker.sock'
}
Node.js v17.9.1
INFO [2022-11-29 18:23:47.880 +0100]: (Re)loading hosts, clearing all existing hosts first
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^
Error: connect EACCES /var/run/docker.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1195:16) {
  errno: -13,
  code: 'EACCES',
  syscall: 'connect',
  address: '/var/run/docker.sock'
}
Node.js v17.9.1
INFO [2022-11-29 18:23:47.882 +0100]: Added proxy host
    host: [
      "dn-petio.monsite.ovh"
    ]
    container: [
      "g-petio"
    ]

    proxy: {
      "host": "glu",
      "port": 7777,
      "useHttps": false
    }
    timeoutSeconds: 600
INFO [2022-11-29 18:23:47.928 +0100]: Proxy listening
    port: 11180
INFO [2022-11-29 18:23:47.940 +0100]: Proxy placeholder server listening
    port: 8080
    host: "127.0.0.1"
INFO [2022-11-29 18:24:00.164 +0100]: (Re)loading hosts, clearing all existing hosts first
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^
Error: connect EACCES /var/run/docker.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1195:16) {
  errno: -13,
  code: 'EACCES',
  syscall: 'connect',
  address: '/var/run/docker.sock'
}
Node.js v17.9.1
INFO [2022-11-29 18:24:15.219 +0100]: (Re)loading hosts, clearing all existing hosts first
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^
Error: connect EACCES /var/run/docker.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1195:16) {
  errno: -13,
  code: 'EACCES',
  syscall: 'connect',
  address: '/var/run/docker.sock'
}
Node.js v17.9.1
Container stopped

2/
Would be nice to be able to choose to "PAUSE/start" instead of "STOP/start" behaviour :)

Please help , best regards :)

warlordattack commented 1 year ago
Finally this worked : 

docker-compose.yml : 

version: "3"
services:
  srv_nursery:
    container_name: ${C_NUR} 
    image: ${C_NUR_IMG}
    restart: ${C_ALL_RESTART}
    hostname: ${C_NUR_HOST}  # nur
    ports:
      - ${C_NUR_80}:80 # 11180
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ${REP_APPDATA}/${C_NUR}:/usr/src/app/config
    environment:
      - CN_PORT=${C_NUR_80} # 11180
      - UMASK=${UMASK}
      - TZ=${TZ}
    labels:
      - "com.centurylinklabs.watchtower.enable=${WATCHTOWER_LABEL_ENABLE}"
    networks:
      - web
networks: 
  web: 
    external: true

config.yml : 

proxyHosts:
  - domain: dn-petio.monsite.ovh
    containerName: g-petio
    proxyHost: glu # gluetun hostname
    proxyPort: 7777 # petio port in gluetun
    timeoutSeconds: 300 # 5 min

Nginx Proxy Manager : 
http://nur:11180