Cybrarist / Discount-Bandit

Track products pricing across multi ecommerce stores such as amazon,ebay,walmart, target and many more.
https://discount-bandit.cybrarist.com
GNU General Public License v3.0
268 stars 11 forks source link

Unable to start with Docker #21

Open yodaphone opened 4 weeks ago

yodaphone commented 4 weeks ago

I'm trying to install it via the docker compose file and i get this error

Gracefully stopping... (press Ctrl+C again to force)
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/jupiter/discountbandit/.database.sqlite" to rootfs at "/app/database/database.sqlite": create mount destination for /app/database/database.sqlite mount: cannot mkdir in /var/lib/docker/overlay2/811443d81ed4801caf8caad47f13cf5368d757aff2f8e5b0fb478cac4f7bfbf7/merged/app/database/database.sqlite: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

this is my docker-compose.yml file

networks:
  discount-bandit:
    driver: bridge

services:
  discount-bandit:
    build:
      context: .
    image: cybrarist/discount-bandit:v3.1.2-amd64
    ports:
      - 8080:80
    networks:
      - discount-bandit
    volumes:
      - ./database/database.sqlite:/app/database/database.sqlite
      - ./.env:/app/.env
    environment:
      DB_CONNECTION: sqlite
      NTFY_CHANNEL_ID: ""
      TELEGRAM_BOT_TOKEN: ""
      TELEGRAM_CHANNEL_ID: ""
      DEFAULT_USER: "test"
      DEFAULT_EMAIL: "docker@test.com"
      DEFAULT_PASSWORD: "thisismypassword"
      APP_TIMEZONE: UTC
      RSS_FEED: 1
      TOP_NAVIGATION: 0
      DISABLE_TOP_BAR: 0
      BREADCRUMBS: 1
      SPA: 1
      DISABLE_AUTH: 1
      THEME_COLOR: Stone
      APP_URL: "http://localhost:8080"
Cybrarist commented 4 weeks ago

did you create the file database.sqlite and .env in your host ?

yodaphone commented 4 weeks ago

I'm using Portainer and using the docker compose contents with web editor

Failed to deploy a stack: Network discountbandit_discount-bandit Creating Network discountbandit_discount-bandit Created Container discountbandit-discount-bandit-1 Creating Container discountbandit-discount-bandit-1 Created Container discountbandit-discount-bandit-1 Starting Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/data/compose/130/database.sqlite" to rootfs at "/app/database/database.sqlite": create mount destination for /app/database/database.sqlite mount: cannot mkdir in /var/lib/docker/overlay2/5707d29359ed1a0585ddd293b68f83133949063857c01ba537267650f050a2fa/merged/app/database/database.sqlite: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

There no way to create a file in portainer & using these instructions https://discount-bandit.cybrarist.com/installation/compose-portainer.html

Cybrarist commented 4 weeks ago

if you are using portainer and you want to run the application with sqlite, you can pull the image directly. no need for docker-compose

yodaphone commented 4 weeks ago

if you are using portainer and you want to run the application with sqlite, you can pull the image directly. no need for docker-compose

But i followed the instructions on your docs

Can you please LMK how to pull image directly using docker? I was planning on creating a stack so that it's easily manageable

Cybrarist commented 4 weeks ago

yes, my apologies, didn't have time to update docs, hopefully this weekend.

but anyway, if you are using portainer, you can do the following for v3.1.2-amd64

1- add the image

image

2- add the desired port and link it to port 80 on container

port

3- add the env variables and change accordingly

DB_CONNECTION=sqlite
NTFY_CHANNEL_ID=""
TELEGRAM_BOT_TOKEN=""
TELEGRAM_CHANNEL_ID=""
DEFAULT_USER="test"
DEFAULT_EMAIL="docker@test.com"
DEFAULT_PASSWORD="thisismypassword"
APP_TIMEZONE=UTC
RSS_FEED=1
TOP_NAVIGATION=0
DISABLE_TOP_BAR=0
BREADCRUMBS=1
SPA=1
DISABLE_AUTH=1
THEME_COLOR=Stone
APP_URL=http://localhost:8080

4- deploy the container. and the app should be working

now if you want to run it using composer, then you need to use the following:

services:
  discount-bandit:
    image: cybrarist/discount-bandit:v3.1.2-amd64
    ports:
      - 8080:80
    environment:
      DB_CONNECTION: sqlite
      NTFY_CHANNEL_ID: ""
      TELEGRAM_BOT_TOKEN: ""
      TELEGRAM_CHANNEL_ID: ""
      DEFAULT_USER: "test"
      DEFAULT_EMAIL: "docker@test.com"
      DEFAULT_PASSWORD: "thisismypassword"
      APP_TIMEZONE: UTC
      RSS_FEED: 1
      TOP_NAVIGATION: 0
      DISABLE_TOP_BAR: 0
      BREADCRUMBS: 1
      SPA: 1
      DISABLE_AUTH: 1
      THEME_COLOR: Stone
      APP_URL: "http://localhost:8080"

you don't need volumes as if i am not mistaken, potainer will create one automatically for you that saves all the data.

ipriyam26 commented 2 days ago

Hi, so my port 8080 is pre-occupied, I selected the 8090 port and changed the port mapping, the app, and the asset URL env. But I cannot see any CSS when I open the app on localhost:8090. Just plain html.

Cybrarist commented 1 day ago

Hi @ipriyam26 , if you open the devtools and check the network requests, is it asking for the css file for the right url.

are you getting something like the following?

Screenshot 2024-11-21 at 12 04 34 AM