Lazytainer icon indicating copy to clipboard operation
Lazytainer copied to clipboard

Net Able to access my application though lazytainer

Open docfactory37 opened this issue 3 years ago • 4 comments

Hi,

Im trying to use lazytainer to stop my container when not in use but im not able to access my application though lazytainer, im sure it is just a miss congiuration as im able to access without lazytainer hoping you can help :)

Docker Compose is below

version: "3"

networks:
  gitea:
    external: false

services:
  lazytainer:
    container_name: lazytainer
    hostname: lazytainer
    image: ghcr.io/vmorganp/lazytainer:1.2.0
    environment:
      - PORT=222,3000          # comma separated list of ports...or just the one 
      - LABEL=lazytainer    # value of lazytainer.marker for other containers that lazytainer checks
      - TIMEOUT=30          # OPTIONAL number of seconds to let container idle
      - MINPACKETTHRESH=10  # OPTIONAL number of packets that must be recieved to keepalive/start container 
      - POLLRATE=1          # OPTIONAL number of seconds to sleep between polls
      - VERBOSE=true        # probably set this to false unless you're debugging or doing the initial demo
    networks:
      - gitea
    ports:
      - 3000:3000
      - 222:22
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
  
  server:
    image: gitea/gitea:1.17.0
    container_name: Gitea
    hostname: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=mysql
      - GITEA__database__HOST=db:3306
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=${DB_PASSWORD}
    restart: always
    networks:
      - gitea
    volumes:
      - /srv/gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    labels:
      - "lazytainer.marker=lazytainer"
      - "lazytainer.sleepMethod=stop"  # can be either "stop" or "pause", or left blank for stop
    depends_on:
      - db
      - lazytainer

  db:
    container_name: Gitea-db
    hostname: gitea-db
    image: linuxserver/mariadb:10.5.16-alpine
    restart: always
    environment:
      - TZ=Australia/Sydney
      - PUID=1000
      - PGID=1000
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=${DB_PASSWORD}
      - MYSQL_DATABASE=gitea
    networks:
      - gitea
    volumes:
      - /srv/gitea-db:/var/lib/mysql
    labels:
      - "lazytainer.marker=lazytainer"
      - "lazytainer.sleepMethod=stop"  # can be either "stop" or "pause", or left blank for stop
    depends_on:
     - lazytainer

docfactory37 avatar Sep 05 '22 04:09 docfactory37

It looks like you're missing the network_mode attribute as documented here https://github.com/vmorganp/Lazytainer#or-put-in-your-docker-composeyaml .

vmorganp avatar Sep 05 '22 05:09 vmorganp

Thank you for the quick response ☺️, I thought missed something simple 😊

docfactory37 avatar Sep 05 '22 08:09 docfactory37

Sorry @vmorganp I had one more question, can you use lazytainer with multiple containers or is it meant to be 1 to 1 ?

docfactory37 avatar Sep 05 '22 20:09 docfactory37

https://www.reddit.com/r/selfhosted/comments/x39p67/comment/impozt/ here's the reddit thread around the same subject, let me know if this helps.

tldr; It should PROBABLY be 1:1

vmorganp avatar Sep 06 '22 07:09 vmorganp

Hey, I'm planning on closing this at the end of the week if there's no additional activity.

vmorganp avatar Sep 26 '22 11:09 vmorganp