Your task container completes the command and ends the container. The scheduler notices that your desired state is 1 replica and spawns a new task container in order to meet the desired state… So basicly the container does execute the command only one time in it’s lifetime.
Either you need a command that prevents that the container completes its task (with smth like tail -f /dev/null as last command if no blocking service should be run)… or even better make it a one-shot task that stays stopped when finished: