Help with docker compose error for tasmoadmin

i am running docker in Linux (Debian 12) for sometime now. I am switching to docker compose and i have an issue to bring up an image. The following is a compose of 4 nginx http servers and a tasmoadmin. It give me errors for tasmoadmin and i cannot identify what i am missing. When executing the docker of tasmoadmin on its own (no docker compose) it runs fine. here is the docker commands:

docker volume create tasmoadmin_data
docker run -d --name=tasmoadmin --restart=always -p 9999:80 -v tasmoadmin_data:/data raymondmm/tasmoadmin

and here is my docker compose file, trying to implement it:

services:
  website:
    image: nginx
    ports:
      - "9997:80"
    restart: always
  website2:
    image: nginx
    ports:
      - "9996:80"
    restart: always
  website3:
    image: nginx
    ports:
      - "9995:80"
    restart: always
  website4:
    image: nginx
    ports:
      - "9994:80"
   restart: always
 tasmoadmin:
    image: raymondmm/tasmoadmin
    ports:
      - "9999:80"
    restart: always
    volumes:
      - tasmoadmin_data:/data raymondmm/tasmoadmin

and here is the error that i am getting:

atsitras@deb12base:~/docker/nginx_tasmo$ docker-compose up -d
ERROR: Named volume "tasmoadmin_data:/data raymondmm/tasmoadmin:rw" is used in service "tasmoadmin" but no declaration was found in the volumes section.
atsitras@deb12base:~/docker/nginx_tasmo$

how do i solve the issue?

Try this

services:
  website:
    image: nginx
    ports:
      - "9997:80"
    restart: always
  website2:
    image: nginx
    ports:
      - "9996:80"
    restart: always
  website3:
    image: nginx
    ports:
      - "9995:80"
    restart: always
  website4:
    image: nginx
    ports:
      - "9994:80"
   restart: always
 tasmoadmin:
    image: raymondmm/tasmoadmin
    ports:
      - "9999:80"
    restart: always
    volumes:
      - tasmoadmin_data:/data raymondmm/tasmoadmin

volumes:
  tasmoadmin_data:
1 Like

It works.
thanks a lot