Does command operation in docker-compose.yml automatically search in entrypoint.sh?

I’m learning docker and here is part of the docker-compose.yml file for a project that I’m learning from:

services:
  ...
  ...    
  redis:
    build: ./redis
    image: smartjoe:redis
    container_name: smartjoe--redis
    command: redis-server
    ports:
      - '9993:6379'
    volumes:
      - /redis
    volumes_from:
      - data 

  data:
    build: ./data
    image: smartjoe:data
    container_name: smartjoe--data
    volumes:
      - /data
      - /var/lib/mysql
      - /var/lib/redis/data
    command: tail -f /dev/null
  ...
  ...

In the line command: redis-server under redis:, I was wondering where the redis-servercame from. After some search I was able to find that it is in a entrypoint.sh file located within the smartjoe--redis container:

/ # ls -la
total 68
drwxr-xr-x    1 root     root          4096 Mar 28 21:24 .
drwxr-xr-x    1 root     root          4096 Mar 28 21:24 ..
-rwxr-xr-x    1 root     root             0 Mar 28 21:24 .dockerenv
drwxr-xr-x    1 root     root          4096 Jun 28  2017 bin
drwxr-xr-x    4 redis    redis         4096 Aug  2 19:51 data
drwxr-xr-x    5 root     root           340 Aug  5 14:54 dev
lrwxrwxrwx    1 root     root            34 Jun 28  2017 entrypoint.sh -> usr/local/bin/docker-entrypoint.sh
drwxr-xr-x    1 root     root          4096 Mar 28 21:24 etc
drwxr-xr-x    1 root     root          4096 Jun 28  2017 home
drwxr-xr-x    1 root     root          4096 Jun 28  2017 lib
drwxr-xr-x    5 root     root          4096 Jun 25  2017 media
drwxr-xr-x    2 root     root          4096 Jun 25  2017 mnt
dr-xr-xr-x  229 root     root             0 Aug  5 14:54 proc
drwxr-xr-x    2 root     root          4096 Sep  7  2018 redis
drwx------    1 root     root          4096 Aug  5 18:14 root
drwxr-xr-x    2 root     root          4096 Jun 25  2017 run
drwxr-xr-x    1 root     root          4096 Jun 28  2017 sbin
drwxr-xr-x    2 root     root          4096 Jun 25  2017 srv
dr-xr-xr-x   13 root     root             0 Aug  1 16:00 sys
drwxrwxrwt    1 root     root          4096 Jun 28  2017 tmp
drwxr-xr-x    1 root     root          4096 Jun 28  2017 usr
drwxr-xr-x    1 root     root          4096 Jun 28  2017 var

And the content of entrypoint.sh looks like:

/ # cat entrypoint.sh 
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
# or first arg is `something.conf`
if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then
    set -- redis-server "[email protected]"
fi

# allow the container to be started with `--user`
if [ "$1" = 'redis-server' -a "$(id -u)" = '0' ]; then
    chown -R redis .
    exec su-exec redis "$0" "[email protected]"
fi

exec "[email protected]"

My question is: I don’t see entrypoint.sh being referenced anywhere in the docker-compose.yml script, does docker just assume there is a such entrypoint.sh file and search the key word after command: in the file?

btw, the Dockerfile is quite simple:

[email protected]:~/smartjoe/smartjoe-local/docker/redis$ cat Dockerfile 
FROM redis:3.0-alpine
MAINTAINER smartjoe Engineering "[email protected]"
[email protected]:~/smartjoe/smartjoe-local/docker/redis$ 

Source: StackOverflow